Don't use mutex
This commit is contained in:
parent
531b28ed2b
commit
6b8386d449
1 changed files with 1 additions and 3 deletions
|
@ -634,8 +634,6 @@ fn section<'a, 'b>(
|
||||||
let (i, section_header) = section_header(i)?;
|
let (i, section_header) = section_header(i)?;
|
||||||
|
|
||||||
let mut newlines = 0;
|
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((
|
let (i, items) = many0(alt((
|
||||||
map(take_spaces, |space| {
|
map(take_spaces, |space| {
|
||||||
vec![Event::Whitespace(Cow::Borrowed(space.into()))]
|
vec![Event::Whitespace(Cow::Borrowed(space.into()))]
|
||||||
|
@ -645,7 +643,7 @@ fn section<'a, 'b>(
|
||||||
vec![Event::Newline(Cow::Borrowed(newline.into()))]
|
vec![Event::Newline(Cow::Borrowed(newline.into()))]
|
||||||
}),
|
}),
|
||||||
map(
|
map(
|
||||||
|i| section_body(i, *node.lock().unwrap()),
|
|i| section_body(i, node),
|
||||||
|(key, values)| {
|
|(key, values)| {
|
||||||
let mut vec = vec![Event::Key(Cow::Borrowed(key.into()))];
|
let mut vec = vec![Event::Key(Cow::Borrowed(key.into()))];
|
||||||
vec.extend(values);
|
vec.extend(values);
|
||||||
|
|
Reference in a new issue