fn to_snippet_no_source<T>(&self, path: &FileRef, span: Span,
      f: impl for<'a> FnOnce(Snippet<'a>) -> T) -> T {
    let s = if span.end == span.start {
      format!("{}:{:#x}: {}", path, span.start, self.kind.msg())
    } else {
      format!("{}:{:#x}-{:#x}: {}", path, span.start, span.end, self.kind.msg())
    };
    f(make_snippet_no_source(&s, self.level))
  }
/// Create a [`Snippet`] from an error when the file source is not available
/// (e.g. for binary files).
///
/// # Parameters
///
/// - `path`: The location of the error
/// - `f`: The function to pass the constructed snippet
Create a [`Snippet`] from an error when the file source is not available
.
Create a [ ` Snippet ` ] from an error when the file source is not available .
fn to_snippet_no_source<T>(&self, path: &FileRef, span: Span,
      f: impl for<'a> FnOnce(Snippet<'a>) -> T) -> T {
    let s = if span.end == span.start {
      format!("{}:{:#x}: {}", path, span.start, self.kind.msg())
    } else {
      format!("{}:{:#x}-{:#x}: {}", path, span.start, span.end, self.kind.msg())
    };
    f(make_snippet_no_source(&s, self.level))
  }
fn to_snippet_no_source < T > ( & self , path : & FileRef , span : Span , f : impl for < ' a > FnOnce ( Snippet < ' a > ) -> T ) -> T { let s = if span . end == span . start { format ! ( " " path span start self kind msg ( ) ) } else { format ! ( " " path span start span end self kind msg ( ) ) } ; f ( make_snippet_no_source ( & s , self . level ) ) }
Create a [`Snippet`] from an error when the file source is not available
(e.g.
Create a [ ` Snippet ` ] from an error when the file source is not available ( e . g .
&self
path
&FileRef
span
Span
f
impl for<'a> FnOnce(Snippet<'a>) -> T
&self
path
&FileRef
The location of the error
The location of the error
span
Span
f
impl for<'a> FnOnce(Snippet<'a>) -> T
The function to pass the constructed snippet
The function to pass the constructed snippet