mirror of https://github.com/zkat/miette.git
docs: Improve linking.
This commit is contained in:
parent
f4d056e1ff
commit
0412aa8ec8
|
|
@ -30,9 +30,9 @@ impl Report {
|
|||
|
||||
/// Create a new error object from a printable error message.
|
||||
///
|
||||
/// If the argument implements std::error::Error, prefer `Report::new`
|
||||
/// If the argument implements [`std::error::Error`], prefer `Report::new`
|
||||
/// instead which preserves the underlying error's cause chain and
|
||||
/// backtrace. If the argument may or may not implement std::error::Error
|
||||
/// backtrace. If the argument may or may not implement [`std::error::Error`]
|
||||
/// now or in the future, use `miette!(err)` which handles either way
|
||||
/// correctly.
|
||||
///
|
||||
|
|
@ -206,7 +206,7 @@ impl Report {
|
|||
/// Create a new error from an error message to wrap the existing error.
|
||||
///
|
||||
/// For attaching a higher level error message to a `Result` as it is
|
||||
/// propagated, the [crate::WrapErr] extension trait may be more
|
||||
/// propagated, the [`WrapErr`](crate::WrapErr) extension trait may be more
|
||||
/// convenient than this function.
|
||||
///
|
||||
/// The primary reason to use `error.wrap_err(...)` instead of
|
||||
|
|
@ -233,7 +233,7 @@ impl Report {
|
|||
unsafe { Report::construct(error, vtable, handler) }
|
||||
}
|
||||
|
||||
/// Compatibility re-export of wrap_err for interop with `anyhow`
|
||||
/// Compatibility re-export of `wrap_err` for interop with `anyhow`
|
||||
pub fn context<D>(self, msg: D) -> Self
|
||||
where
|
||||
D: Display + Send + Sync + 'static,
|
||||
|
|
|
|||
|
|
@ -55,9 +55,9 @@ impl GraphicalTheme {
|
|||
|
||||
/// A "basic" graphical theme that skips colors and unicode characters and
|
||||
/// just does monochrome ascii art. If you want a completely non-graphical
|
||||
/// rendering of your `Diagnostic`s, check out
|
||||
/// [crate::NarratableReportHandler], or write your own
|
||||
/// [crate::ReportHandler]!
|
||||
/// rendering of your [`Diagnostic`](crate::Diagnostic)s, check out
|
||||
/// [`NarratableReportHandler`](crate::NarratableReportHandler), or write
|
||||
/// your own [`ReportHandler`](crate::ReportHandler)
|
||||
pub fn none() -> Self {
|
||||
Self {
|
||||
characters: ThemeCharacters::ascii(),
|
||||
|
|
@ -79,7 +79,8 @@ impl Default for GraphicalTheme {
|
|||
}
|
||||
|
||||
/**
|
||||
Styles for various parts of graphical rendering for the [crate::GraphicalReportHandler].
|
||||
Styles for various parts of graphical rendering for the
|
||||
[`GraphicalReportHandler`](crate::GraphicalReportHandler).
|
||||
*/
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ThemeStyles {
|
||||
|
|
@ -159,7 +160,7 @@ impl ThemeStyles {
|
|||
// https://github.com/zesterer/ariadne/blob/e3cb394cb56ecda116a0a1caecd385a49e7f6662/src/draw.rs
|
||||
|
||||
/// Characters to be used when drawing when using
|
||||
/// [crate::GraphicalReportHandler].
|
||||
/// [`GraphicalReportHandler`](crate::GraphicalReportHandler).
|
||||
#[allow(missing_docs)]
|
||||
#[derive(Debug, Clone, Eq, PartialEq)]
|
||||
pub struct ThemeCharacters {
|
||||
|
|
|
|||
|
|
@ -232,7 +232,7 @@ whole thing--meaning you should be able to support `SourceCode`s which are
|
|||
gigabytes or larger in size.
|
||||
*/
|
||||
pub trait SourceCode: Send + Sync {
|
||||
/// Read the bytes for a specific span from this SourceCode, keeping a
|
||||
/// Read the bytes for a specific span from this `SourceCode`, keeping a
|
||||
/// certain number of lines before and after the span as context.
|
||||
fn read_span<'a>(
|
||||
&'a self,
|
||||
|
|
|
|||
Loading…
Reference in New Issue