From 6b8386d4492926454138e8eac0f30b53078e151e Mon Sep 17 00:00:00 2001 From: Edward Shen Date: Fri, 26 Feb 2021 18:54:35 -0500 Subject: [PATCH] Don't use mutex --- src/parser.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/parser.rs b/src/parser.rs index ec736f9..85bf687 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -634,8 +634,6 @@ fn section<'a, 'b>( let (i, section_header) = section_header(i)?; let mut newlines = 0; - // todo: unhack this (manually implement many0 and alt to avoid closure moves) - let node = std::sync::Mutex::new(node); let (i, items) = many0(alt(( map(take_spaces, |space| { vec![Event::Whitespace(Cow::Borrowed(space.into()))] @@ -645,7 +643,7 @@ fn section<'a, 'b>( vec![Event::Newline(Cow::Borrowed(newline.into()))] }), map( - |i| section_body(i, *node.lock().unwrap()), + |i| section_body(i, node), |(key, values)| { let mut vec = vec![Event::Key(Cow::Borrowed(key.into()))]; vec.extend(values);