pub fn extract_raw_starlark_docstring(body: &AstStmt) -> Option<String> {
        if let Stmt::Statements(stmts) = &body.node {
            if let Some(Spanned {
                node:
                    Stmt::Expression(Spanned {
                        node: Expr::Literal(AstLiteral::StringLiteral(s)),
                        ..
                    }),
                ..
            }) = stmts.first()
            {
                return Some(s.node.to_owned());
            }
        };
        None
    }
/// Extracts the docstring from a function or module body, iff the first
/// statement is a string literal.
Extracts the docstring from a function or module body, iff the first
statement is a string literal.
Extracts the docstring from a function or module body iff the first statement is a string literal .
pub fn extract_raw_starlark_docstring(body: &AstStmt) -> Option<String> {
        if let Stmt::Statements(stmts) = &body.node {
            if let Some(Spanned {
                node:
                    Stmt::Expression(Spanned {
                        node: Expr::Literal(AstLiteral::StringLiteral(s)),
                        ..
                    }),
                ..
            }) = stmts.first()
            {
                return Some(s.node.to_owned());
            }
        };
        None
    }
pub fn extract_raw_starlark_docstring ( body : & AstStmt ) -> Option < String > { if let Stmt :: Statements ( stmts ) = & body . node { if let Some ( Spanned { node : Stmt :: Expression ( Spanned { node : Expr :: Literal ( AstLiteral :: StringLiteral ( s ) ) , .. } ) , .. } ) = stmts . first ( ) { return Some ( s . node . to_owned ( ) ) ; } } ; None }
Extracts the docstring from a function or module body, iff the first
statement is a string literal.
Extracts the docstring from a function or module body iff the first statement is a string literal .
body
&AstStmt
body
&AstStmt