Skip to content

Commit

Permalink
Consider the case of a Yields section
Browse files Browse the repository at this point in the history
  • Loading branch information
AloizioMacedo committed Jun 24, 2024
1 parent 34e67f6 commit 8853d12
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/parsing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ pub fn parse_google_docstring(
) -> Option<Vec<(&str, Option<&str>)>> {
let (_, mut args) = text.split_once("Args:\n")?;

if let Some(c) = args.find("Yields:\n") {
args = &args[..c];
};

if let Some(c) = args.find("Returns:\n") {
args = &args[..c];
};
Expand Down

0 comments on commit 8853d12

Please sign in to comment.