Removed trim fron inner parenthesized

This commit is contained in:
Martin Berg Alstad 2024-07-17 12:48:09 +02:00
parent 5cd1c075a5
commit 3389b2264e
3 changed files with 5 additions and 5 deletions

2
Cargo.lock generated
View File

@ -303,7 +303,7 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
[[package]] [[package]]
name = "lib" name = "lib"
version = "1.4.0" version = "1.4.1"
dependencies = [ dependencies = [
"axum", "axum",
"into-response-derive", "into-response-derive",

View File

@ -9,7 +9,7 @@ homepage = "emberal.github.io"
[package] [package]
name = "lib" name = "lib"
version = "1.4.0" version = "1.4.1"
description = "A library with utilities and helper fuctions." description = "A library with utilities and helper fuctions."
edition = { workspace = true } edition = { workspace = true }
rust-version = { workspace = true } rust-version = { workspace = true }

View File

@ -31,8 +31,7 @@ pub fn parenthesized<'a, Parser, R>(inner: Parser) -> impl FnMut(&'a str) -> IRe
where where
Parser: FnMut(&'a str) -> IResult<&'a str, R>, Parser: FnMut(&'a str) -> IResult<&'a str, R>,
{ {
// TODO move trim out of here delimited(char('('), inner, char(')'))
delimited(char('('), trim(inner), char(')'))
} }
/// Take where the predicate is true and the length is exactly `n` /// Take where the predicate is true and the length is exactly `n`
@ -57,9 +56,10 @@ where
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*;
use nom::{bytes::complete::take_while, sequence::tuple}; use nom::{bytes::complete::take_while, sequence::tuple};
use super::*;
#[test] #[test]
fn test_trim_both_sides() { fn test_trim_both_sides() {
let input = " test "; let input = " test ";