Crates.io | doc_consts_derive |
lib.rs | doc_consts_derive |
version | 0.2.1 |
source | src |
created_at | 2023-08-02 14:37:46.516613 |
updated_at | 2024-11-19 17:46:03.303324 |
description | get doc comments on fields as runtime constants |
homepage | https://github.com/MnlPhlp/doc_consts |
repository | https://github.com/MnlPhlp/doc_consts |
max_upload_size | |
id | 932767 |
size | 6,054 |
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);
}
Set the no_std
feature to remove map access and make the crate no_std
compatible