code_docs/lib.rs
1mod documented_struct;
2mod documented_enum;
3mod documented_consts;
4
5pub use documented_struct::DocumentedStruct;
6pub use documented_enum::DocumentedEnum;
7pub use documented_consts::DocumentedConstants;
8
9pub(crate) fn filter_docs(meta: &str) -> Option<&str> {
10 // i do not want to use regex crate
11 meta.strip_prefix("doc = r\"")
12 .or(meta.strip_prefix("doc =\nr\"")) // there was a newline before comment
13 .and_then(|x| x.strip_suffix("\"")) // remove the quotes
14}
15