Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'xtask/src/publish/notes.rs')
| -rw-r--r-- | xtask/src/publish/notes.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/xtask/src/publish/notes.rs b/xtask/src/publish/notes.rs index 7245ce2431..93592d4986 100644 --- a/xtask/src/publish/notes.rs +++ b/xtask/src/publish/notes.rs @@ -85,7 +85,7 @@ impl<'a, 'b, R: BufRead> Converter<'a, 'b, R> { } fn process_list(&mut self) -> anyhow::Result<()> { - let mut nesting = ListNesting::new(); + let mut nesting = ListNesting::default(); while let Some(line) = self.iter.peek() { let line = line.as_deref().map_err(|e| anyhow!("{e}"))?; @@ -385,10 +385,6 @@ fn parse_media_block<'a>(line: &'a str, prefix: &str) -> Option<(&'a str, &'a st struct ListNesting(Vec<ListMarker>); impl ListNesting { - fn new() -> Self { - Self(Vec::<ListMarker>::with_capacity(6)) - } - fn current(&mut self) -> Option<&ListMarker> { self.0.last() } @@ -417,6 +413,12 @@ impl ListNesting { } } +impl Default for ListNesting { + fn default() -> Self { + Self(Vec::<ListMarker>::with_capacity(6)) + } +} + #[derive(Debug, PartialEq, Eq)] enum ListMarker { Asterisk(usize), |