Crate code_path

source ·
Expand description

code-path

A code path macro

Usage

fn foo() -> String {
    fn bar() -> String {
        code_path::with_loc!()
    }
    bar()
}
assert_eq!(foo(), "rust_out::main::_doctest_main_src_lib_rs_6_0::foo::bar, src/lib.rs:7:9");

Macros

  • Returns the code location
  • Returns the current code path. It could be used in errors, logs, etc to avoid typos.
  • Returns the code location