Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
wetfloo committed Dec 27, 2024
1 parent 69fc928 commit 56ea830
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
mod net;
mod trace;

use clap::Parser as _;
use cnova::op;
Expand Down
7 changes: 7 additions & 0 deletions src/trace.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
use core::fmt;

/// Allows the implementor to present itself nicely in some user-facing scenario. This is almost
/// like [`fmt::Display`], except that you don't need the type to be [`fmt::Display`], which is useful for
/// types like [`Option`] and [`Result`]
pub struct Trace<T>(T);

impl<T, E> fmt::Display for Trace<&Result<T, E>>
Expand Down Expand Up @@ -27,7 +30,11 @@ where
}
}

/// See [`Trace`] documentation
pub trait TraceExt {
// Seems like the compiler can't see that this method is used for macros
// and generates warnings for it, so that's why it has to be allowed
#[allow(unused)]
fn trace(&self) -> Trace<&Self>;
}

Expand Down

0 comments on commit 56ea830

Please sign in to comment.