mirror of https://github.com/zkat/miette.git
fix: fix Rust v1.78.0 clippy warnings
This commit is contained in:
parent
813232ba79
commit
375143f8f6
|
|
@ -410,7 +410,7 @@ impl Report {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Provide source code for this error
|
/// Provide source code for this error
|
||||||
pub fn with_source_code(self, source_code: impl SourceCode + Send + Sync + 'static) -> Report {
|
pub fn with_source_code(self, source_code: impl SourceCode + 'static) -> Report {
|
||||||
WithSourceCode {
|
WithSourceCode {
|
||||||
source_code,
|
source_code,
|
||||||
error: self,
|
error: self,
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ pub struct Report {
|
||||||
unsafe impl Sync for Report {}
|
unsafe impl Sync for Report {}
|
||||||
unsafe impl Send for Report {}
|
unsafe impl Send for Report {}
|
||||||
|
|
||||||
///
|
#[allow(missing_docs)]
|
||||||
pub type ErrorHook =
|
pub type ErrorHook =
|
||||||
Box<dyn Fn(&(dyn Diagnostic + 'static)) -> Box<dyn ReportHandler> + Sync + Send + 'static>;
|
Box<dyn Fn(&(dyn Diagnostic + 'static)) -> Box<dyn ReportHandler> + Sync + Send + 'static>;
|
||||||
|
|
||||||
|
|
@ -109,7 +109,7 @@ fn get_default_printer(_err: &(dyn Diagnostic + 'static)) -> Box<dyn ReportHandl
|
||||||
}
|
}
|
||||||
|
|
||||||
impl dyn ReportHandler {
|
impl dyn ReportHandler {
|
||||||
///
|
#[allow(missing_docs)]
|
||||||
pub fn is<T: ReportHandler>(&self) -> bool {
|
pub fn is<T: ReportHandler>(&self) -> bool {
|
||||||
// Get `TypeId` of the type this function is instantiated with.
|
// Get `TypeId` of the type this function is instantiated with.
|
||||||
let t = core::any::TypeId::of::<T>();
|
let t = core::any::TypeId::of::<T>();
|
||||||
|
|
@ -121,7 +121,7 @@ impl dyn ReportHandler {
|
||||||
t == concrete
|
t == concrete
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
#[allow(missing_docs)]
|
||||||
pub fn downcast_ref<T: ReportHandler>(&self) -> Option<&T> {
|
pub fn downcast_ref<T: ReportHandler>(&self) -> Option<&T> {
|
||||||
if self.is::<T>() {
|
if self.is::<T>() {
|
||||||
unsafe { Some(&*(self as *const dyn ReportHandler as *const T)) }
|
unsafe { Some(&*(self as *const dyn ReportHandler as *const T)) }
|
||||||
|
|
@ -130,7 +130,7 @@ impl dyn ReportHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
#[allow(missing_docs)]
|
||||||
pub fn downcast_mut<T: ReportHandler>(&mut self) -> Option<&mut T> {
|
pub fn downcast_mut<T: ReportHandler>(&mut self) -> Option<&mut T> {
|
||||||
if self.is::<T>() {
|
if self.is::<T>() {
|
||||||
unsafe { Some(&mut *(self as *mut dyn ReportHandler as *mut T)) }
|
unsafe { Some(&mut *(self as *mut dyn ReportHandler as *mut T)) }
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue