Skip to content

get doc comments on fields as runtime constants

License

Notifications You must be signed in to change notification settings

dishmaker/doc_consts

 
 

Repository files navigation

doc_consts

get doc comments on fields as runtime constants

#[derive(DocConsts)]
struct Test {
    /// doc comment
    ///     with indentation
    field: (),
    /// another doc comment
    field2: (),
}

#[test]
fn it_works() {
    assert_eq!("doc comment\n    with indentation", Test::get_docs().field);
    assert_eq!("another doc comment", Test::get_docs().field2);
}

About

get doc comments on fields as runtime constants

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%