From 8853d12581bf61960c1d000df1183dd5ab2ea3be Mon Sep 17 00:00:00 2001 From: Aloizio Macedo Date: Mon, 24 Jun 2024 09:16:59 -0300 Subject: [PATCH] Consider the case of a Yields section --- src/parsing.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/parsing.rs b/src/parsing.rs index d696ffc..e27612a 100644 --- a/src/parsing.rs +++ b/src/parsing.rs @@ -44,6 +44,10 @@ pub fn parse_google_docstring( ) -> Option)>> { 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]; };