doc_consts

Crates.iodoc_consts
lib.rsdoc_consts
version0.3.1
sourcesrc
created_at2023-08-02 12:28:42.385799
updated_at2024-11-19 17:46:10.111681
descriptionget doc comments on fields as runtime constants
homepagehttps://github.com/MnlPhlp/doc_consts
repositoryhttps://github.com/MnlPhlp/doc_consts
max_upload_size
id932678
size15,713
Manuel Philipp (MnlPhlp)

documentation

README

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);
}

no_std support

Set the no_std feature to remove map access and make the crate no_std compatible

Commit count: 25

cargo fmt