Skip to content

Commit

Permalink
docs: Improve linking. (#289)
Browse files Browse the repository at this point in the history
  • Loading branch information
waywardmonkeys authored Sep 18, 2023
1 parent f4d056e commit a9c2bae
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/eyreish/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down Expand Up @@ -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
Expand All @@ -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,
Expand Down
11 changes: 6 additions & 5 deletions src/handlers/theme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a9c2bae

Please sign in to comment.