forc_doc/render/util/format/
code_block.rs

1/// Takes a formatted function signature & body and returns only the signature.
2pub(crate) fn trim_fn_body(f: String) -> String {
3    match f.find('{') {
4        Some(index) => f.split_at(index).0.to_string(),
5        None => f,
6    }
7}