From 249180b1e081298d729ad47ffaec763d4294f414 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Sat, 3 Dec 2022 16:29:19 +0800 Subject: [PATCH] Fix builds. --- src/parser.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/parser.rs b/src/parser.rs index 5cb9ae15..bd60a331 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -3235,9 +3235,9 @@ impl Engine { #[cfg(not(feature = "no_function"))] #[cfg(feature = "metadata")] let comments = { - let mut comments = StaticVec::::new(); + let mut comments = StaticVec::::new(); let mut comments_pos = Position::NONE; - let mut buf = String::new(); + let mut buf = Identifier::new(); // Handle doc-comments. while let (Token::Comment(ref comment), pos) = input.peek().expect(NEVER_ENDS) { @@ -3263,7 +3263,7 @@ impl Engine { } let c = unindent_block_comment(*comment, pos.position().unwrap_or(1) - 1); - comments.push(c); + comments.push(c.into()); } else { if !buf.is_empty() { buf.push('\n'); @@ -3365,7 +3365,6 @@ impl Engine { lib, access, new_settings, - #[cfg(not(feature = "no_function"))] #[cfg(feature = "metadata")] comments, )?; @@ -3567,14 +3566,14 @@ impl Engine { /// Parse a function definition. #[cfg(not(feature = "no_function"))] - fn parse_fn>( + fn parse_fn( &self, input: &mut TokenStream, state: &mut ParseState, lib: &mut FnLib, access: crate::FnAccess, settings: ParseSettings, - #[cfg(feature = "metadata")] comments: impl IntoIterator, + #[cfg(feature = "metadata")] comments: impl IntoIterator, ) -> ParseResult { let settings = settings; @@ -3659,7 +3658,7 @@ impl Engine { #[cfg(not(feature = "no_module"))] environ: None, #[cfg(feature = "metadata")] - comments: comments.into_iter().map(Into::into).collect(), + comments: comments.into_iter().collect(), }) }