/// Extract a few key things out of the main function docstring
Extract a few key things out of the main function docstring
Extract a few key things out of the main function docstring
fn parse_docstring(
        &self,
    ) -> (
        Option<DocString>,
        HashMap<String, Option<DocString>>,
        Option<DocString>,
    ) {
        let docstring = self
            .docstring
            .as_ref()
            .and_then(|s| DocString::from_docstring(s));
        let mut param_docs = HashMap::new();
        let mut return_docs = None;
        if let Some(ds) = &docstring {
            let sections = ds.parse_sections();
            if let Some(args) = sections.get("args") {
                param_docs = DocString::parse_params(args)
                    .into_iter()
                    .map(|(name, docs)| (name, DocString::from_docstring(&docs)))
                    .collect();
            }
            if let Some(docs) = sections.get("returns") {
                return_docs = DocString::from_docstring(docs);
            }
        };
        (docstring, param_docs, return_docs)
    }
fn parse_docstring ( & self , ) -> ( Option < DocString > , HashMap < String , Option < DocString > > , Option < DocString > , ) { let docstring = self . docstring . as_ref ( ) . and_then ( | s | DocString :: from_docstring ( s ) ) ; let mut param_docs = HashMap :: new ( ) ; let mut return_docs = None ; if let Some ( ds ) = & docstring { let sections = ds . parse_sections ( ) ; if let Some ( args ) = sections . get ( " " ) { param_docs = DocString :: parse_params ( args ) . into_iter ( ) . map ( | ( name , docs ) | ( name , DocString :: from_docstring ( & docs ) ) ) . collect ( ) ; } if let Some ( docs ) = sections . get ( " " ) { return_docs = DocString :: from_docstring ( docs ) ; } } ; ( docstring , param_docs , return_docs ) }
Extract a few key things out of the main function docstring
Extract a few key things out of the main function docstring
&self