Update nom dependency
parent
2c23ca34cd
commit
721891c295
|
@ -28,12 +28,6 @@ dependencies = [
|
||||||
"memchr",
|
"memchr",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "arrayvec"
|
|
||||||
version = "0.5.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "async-broadcast"
|
name = "async-broadcast"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
|
@ -1005,19 +999,6 @@ version = "1.3.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
|
checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "lexical-core"
|
|
||||||
version = "0.7.6"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe"
|
|
||||||
dependencies = [
|
|
||||||
"arrayvec",
|
|
||||||
"bitflags",
|
|
||||||
"cfg-if 1.0.0",
|
|
||||||
"ryu",
|
|
||||||
"static_assertions",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.125"
|
version = "0.2.125"
|
||||||
|
@ -1212,6 +1193,12 @@ version = "0.3.16"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d"
|
checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "minimal-lexical"
|
||||||
|
version = "0.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "miniz_oxide"
|
name = "miniz_oxide"
|
||||||
version = "0.5.1"
|
version = "0.5.1"
|
||||||
|
@ -1320,13 +1307,12 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nom"
|
name = "nom"
|
||||||
version = "5.1.2"
|
version = "7.1.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af"
|
checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"lexical-core",
|
|
||||||
"memchr",
|
"memchr",
|
||||||
"version_check",
|
"minimal-lexical",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
|
@ -22,7 +22,7 @@ path = "src/lib.rs"
|
||||||
bitflags = "1.0"
|
bitflags = "1.0"
|
||||||
data-encoding = "2.1.1"
|
data-encoding = "2.1.1"
|
||||||
encoding = "0.2.33"
|
encoding = "0.2.33"
|
||||||
nom = { version = "5" }
|
nom = { version = "7" }
|
||||||
|
|
||||||
indexmap = { version = "^1.5", features = ["serde-1", ] }
|
indexmap = { version = "^1.5", features = ["serde-1", ] }
|
||||||
notify = { version = "4.0.15", optional = true }
|
notify = { version = "4.0.15", optional = true }
|
||||||
|
|
|
@ -24,15 +24,15 @@ use crate::conf::AccountSettings;
|
||||||
use crate::error::{MeliError, Result};
|
use crate::error::{MeliError, Result};
|
||||||
use crate::get_conf_val;
|
use crate::get_conf_val;
|
||||||
use nom::{
|
use nom::{
|
||||||
branch::alt, bytes::complete::tag, combinator::map, error::ErrorKind,
|
branch::alt, bytes::complete::tag, combinator::map, error::Error as NomError, error::ErrorKind,
|
||||||
multi::separated_nonempty_list, sequence::separated_pair, IResult,
|
multi::separated_list1, sequence::separated_pair, IResult,
|
||||||
};
|
};
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
use std::time::SystemTime;
|
use std::time::SystemTime;
|
||||||
|
|
||||||
pub fn managesieve_capabilities(input: &[u8]) -> Result<Vec<(&[u8], &[u8])>> {
|
pub fn managesieve_capabilities(input: &[u8]) -> Result<Vec<(&[u8], &[u8])>> {
|
||||||
let (_, ret) = separated_nonempty_list(
|
let (_, ret) = separated_list1(
|
||||||
tag(b"\r\n"),
|
tag(b"\r\n"),
|
||||||
alt((
|
alt((
|
||||||
separated_pair(quoted_raw, tag(b" "), quoted_raw),
|
separated_pair(quoted_raw, tag(b" "), quoted_raw),
|
||||||
|
@ -58,7 +58,10 @@ fn test_managesieve_capabilities() {
|
||||||
// Return a byte sequence surrounded by "s and decoded if necessary
|
// Return a byte sequence surrounded by "s and decoded if necessary
|
||||||
pub fn quoted_raw(input: &[u8]) -> IResult<&[u8], &[u8]> {
|
pub fn quoted_raw(input: &[u8]) -> IResult<&[u8], &[u8]> {
|
||||||
if input.is_empty() || input[0] != b'"' {
|
if input.is_empty() || input[0] != b'"' {
|
||||||
return Err(nom::Err::Error((input, ErrorKind::Tag)));
|
return Err(nom::Err::Error(NomError {
|
||||||
|
input,
|
||||||
|
code: ErrorKind::Tag,
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut i = 1;
|
let mut i = 1;
|
||||||
|
@ -69,7 +72,10 @@ pub fn quoted_raw(input: &[u8]) -> IResult<&[u8], &[u8]> {
|
||||||
i += 1;
|
i += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
Err(nom::Err::Error((input, ErrorKind::Tag)))
|
Err(nom::Err::Error(NomError {
|
||||||
|
input,
|
||||||
|
code: ErrorKind::Tag,
|
||||||
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait ManageSieve {
|
pub trait ManageSieve {
|
||||||
|
|
|
@ -33,7 +33,7 @@ use nom::{
|
||||||
character::complete::digit1,
|
character::complete::digit1,
|
||||||
character::is_digit,
|
character::is_digit,
|
||||||
combinator::{map, map_res, opt},
|
combinator::{map, map_res, opt},
|
||||||
multi::{fold_many1, length_data, many0, many1, separated_nonempty_list},
|
multi::{fold_many1, length_data, many0, many1, separated_list1},
|
||||||
sequence::{delimited, preceded},
|
sequence::{delimited, preceded},
|
||||||
};
|
};
|
||||||
use std::convert::TryFrom;
|
use std::convert::TryFrom;
|
||||||
|
@ -823,7 +823,7 @@ macro_rules! flags_to_imap_list {
|
||||||
pub fn capabilities(input: &[u8]) -> IResult<&[u8], Vec<&[u8]>> {
|
pub fn capabilities(input: &[u8]) -> IResult<&[u8], Vec<&[u8]>> {
|
||||||
let (input, _) = take_until("CAPABILITY ")(input)?;
|
let (input, _) = take_until("CAPABILITY ")(input)?;
|
||||||
let (input, _) = tag("CAPABILITY ")(input)?;
|
let (input, _) = tag("CAPABILITY ")(input)?;
|
||||||
let (input, ret) = separated_nonempty_list(tag(" "), is_not(" ]\r\n"))(input)?;
|
let (input, ret) = separated_list1(tag(" "), is_not(" ]\r\n"))(input)?;
|
||||||
let (input, _) = take_until("\r\n")(input)?;
|
let (input, _) = take_until("\r\n")(input)?;
|
||||||
let (input, _) = tag("\r\n")(input)?;
|
let (input, _) = tag("\r\n")(input)?;
|
||||||
Ok((input, ret))
|
Ok((input, ret))
|
||||||
|
@ -981,7 +981,7 @@ pub fn search_results<'a>(input: &'a [u8]) -> IResult<&'a [u8], Vec<ImapNum>> {
|
||||||
alt((
|
alt((
|
||||||
|input: &'a [u8]| -> IResult<&'a [u8], Vec<ImapNum>> {
|
|input: &'a [u8]| -> IResult<&'a [u8], Vec<ImapNum>> {
|
||||||
let (input, _) = tag("* SEARCH ")(input)?;
|
let (input, _) = tag("* SEARCH ")(input)?;
|
||||||
let (input, list) = separated_nonempty_list(
|
let (input, list) = separated_list1(
|
||||||
tag(b" "),
|
tag(b" "),
|
||||||
map_res(is_not(" \r\n"), |s: &[u8]| {
|
map_res(is_not(" \r\n"), |s: &[u8]| {
|
||||||
ImapNum::from_str(unsafe { std::str::from_utf8_unchecked(s) })
|
ImapNum::from_str(unsafe { std::str::from_utf8_unchecked(s) })
|
||||||
|
@ -1367,7 +1367,7 @@ pub fn envelope_addresses<'a>(
|
||||||
let (input, _) = tag("(")(input)?;
|
let (input, _) = tag("(")(input)?;
|
||||||
let (input, envelopes) = fold_many1(
|
let (input, envelopes) = fold_many1(
|
||||||
delimited(tag("("), envelope_address, tag(")")),
|
delimited(tag("("), envelope_address, tag(")")),
|
||||||
SmallVec::new(),
|
SmallVec::new,
|
||||||
|mut acc, item| {
|
|mut acc, item| {
|
||||||
acc.push(item);
|
acc.push(item);
|
||||||
acc
|
acc
|
||||||
|
@ -1472,11 +1472,11 @@ pub fn quoted_or_nil(input: &[u8]) -> IResult<&[u8], Option<Vec<u8>>> {
|
||||||
alt((map(tag("NIL"), |_| None), map(quoted, Some)))(input.ltrim())
|
alt((map(tag("NIL"), |_| None), map(quoted, Some)))(input.ltrim())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn uid_fetch_envelopes_response(
|
pub fn uid_fetch_envelopes_response<'a>(
|
||||||
input: &[u8],
|
input: &'a [u8],
|
||||||
) -> IResult<&[u8], Vec<(UID, Option<(Flag, Vec<String>)>, Envelope)>> {
|
) -> IResult<&'a [u8], Vec<(UID, Option<(Flag, Vec<String>)>, Envelope)>> {
|
||||||
many0(
|
many0(
|
||||||
|input: &[u8]| -> IResult<&[u8], (UID, Option<(Flag, Vec<String>)>, Envelope)> {
|
|input: &'a [u8]| -> IResult<&'a [u8], (UID, Option<(Flag, Vec<String>)>, Envelope)> {
|
||||||
let (input, _) = tag("* ")(input)?;
|
let (input, _) = tag("* ")(input)?;
|
||||||
let (input, _) = take_while(is_digit)(input)?;
|
let (input, _) = take_while(is_digit)(input)?;
|
||||||
let (input, _) = tag(" FETCH (")(input)?;
|
let (input, _) = tag(" FETCH (")(input)?;
|
||||||
|
|
|
@ -131,7 +131,7 @@ use crate::shellexpand::ShellExpandTrait;
|
||||||
use nom::bytes::complete::tag;
|
use nom::bytes::complete::tag;
|
||||||
use nom::character::complete::digit1;
|
use nom::character::complete::digit1;
|
||||||
use nom::combinator::map_res;
|
use nom::combinator::map_res;
|
||||||
use nom::{self, error::ErrorKind, IResult};
|
use nom::{self, error::Error as NomError, error::ErrorKind, IResult};
|
||||||
|
|
||||||
extern crate notify;
|
extern crate notify;
|
||||||
use self::notify::{watcher, DebouncedEvent, RecursiveMode, Watcher};
|
use self::notify::{watcher, DebouncedEvent, RecursiveMode, Watcher};
|
||||||
|
@ -491,7 +491,10 @@ impl MboxFormat {
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
debug!("Could not parse mail {:?}", err);
|
debug!("Could not parse mail {:?}", err);
|
||||||
Err(nom::Err::Error((input, ErrorKind::Tag)))
|
Err(nom::Err::Error(NomError {
|
||||||
|
input,
|
||||||
|
code: ErrorKind::Tag,
|
||||||
|
}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -535,7 +538,10 @@ impl MboxFormat {
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
debug!("Could not parse mail at {:?}", err);
|
debug!("Could not parse mail at {:?}", err);
|
||||||
Err(nom::Err::Error((input, ErrorKind::Tag)))
|
Err(nom::Err::Error(NomError {
|
||||||
|
input,
|
||||||
|
code: ErrorKind::Tag,
|
||||||
|
}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -589,7 +595,10 @@ impl MboxFormat {
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
debug!("Could not parse mail {:?}", err);
|
debug!("Could not parse mail {:?}", err);
|
||||||
Err(nom::Err::Error((input, ErrorKind::Tag)))
|
Err(nom::Err::Error(NomError {
|
||||||
|
input,
|
||||||
|
code: ErrorKind::Tag,
|
||||||
|
}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -633,7 +642,10 @@ impl MboxFormat {
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
debug!("Could not parse mail {:?}", err);
|
debug!("Could not parse mail {:?}", err);
|
||||||
Err(nom::Err::Error((input, ErrorKind::Tag)))
|
Err(nom::Err::Error(NomError {
|
||||||
|
input,
|
||||||
|
code: ErrorKind::Tag,
|
||||||
|
}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -724,7 +736,10 @@ pub fn mbox_parse(
|
||||||
format: Option<MboxFormat>,
|
format: Option<MboxFormat>,
|
||||||
) -> IResult<&[u8], Vec<Envelope>> {
|
) -> IResult<&[u8], Vec<Envelope>> {
|
||||||
if input.is_empty() {
|
if input.is_empty() {
|
||||||
return Err(nom::Err::Error((input, ErrorKind::Tag)));
|
return Err(nom::Err::Error(NomError {
|
||||||
|
input,
|
||||||
|
code: ErrorKind::Tag,
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
let mut offset = 0;
|
let mut offset = 0;
|
||||||
let mut index = index.lock().unwrap();
|
let mut index = index.lock().unwrap();
|
||||||
|
|
|
@ -28,7 +28,7 @@ use nom::{
|
||||||
combinator::peek,
|
combinator::peek,
|
||||||
combinator::{map, opt},
|
combinator::{map, opt},
|
||||||
error::{context, ErrorKind},
|
error::{context, ErrorKind},
|
||||||
multi::{many0, many1, separated_nonempty_list},
|
multi::{many0, many1, separated_list1},
|
||||||
number::complete::le_u8,
|
number::complete::le_u8,
|
||||||
sequence::{delimited, pair, preceded, separated_pair, terminated},
|
sequence::{delimited, pair, preceded, separated_pair, terminated},
|
||||||
};
|
};
|
||||||
|
@ -112,6 +112,17 @@ impl<I> nom::error::ParseError<I> for ParsingError<I> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<I, E> nom::error::FromExternalError<I, E> for ParsingError<I> {
|
||||||
|
fn from_external_error(input: I, kind: ErrorKind, _e: E) -> Self {
|
||||||
|
Self {
|
||||||
|
input,
|
||||||
|
error: kind.description().to_string().into(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<I> nom::error::ContextError<I> for ParsingError<I> {}
|
||||||
|
|
||||||
impl<'i> From<ParsingError<&'i [u8]>> for MeliError {
|
impl<'i> From<ParsingError<&'i [u8]>> for MeliError {
|
||||||
fn from(val: ParsingError<&'i [u8]>) -> MeliError {
|
fn from(val: ParsingError<&'i [u8]>) -> MeliError {
|
||||||
MeliError::new("Parsing error").set_summary(format!(
|
MeliError::new("Parsing error").set_summary(format!(
|
||||||
|
@ -155,6 +166,15 @@ impl<'i> From<nom::Err<ParsingError<&'i str>>> for MeliError {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<nom::Err<nom::error::Error<&[u8]>>> for MeliError {
|
||||||
|
fn from(val: nom::Err<nom::error::Error<&[u8]>>) -> MeliError {
|
||||||
|
match val {
|
||||||
|
nom::Err::Incomplete(_) => MeliError::new("Parsing Error: Incomplete"),
|
||||||
|
nom::Err::Error(_) | nom::Err::Failure(_) => MeliError::new("Parsing Error"),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
macro_rules! is_ctl_or_space {
|
macro_rules! is_ctl_or_space {
|
||||||
($var:ident) => {
|
($var:ident) => {
|
||||||
/* <any ASCII control character and DEL> */
|
/* <any ASCII control character and DEL> */
|
||||||
|
@ -1158,7 +1178,7 @@ pub mod mailing_lists {
|
||||||
pub fn rfc_2369_list_headers_action_list(input: &[u8]) -> IResult<&[u8], Vec<&[u8]>> {
|
pub fn rfc_2369_list_headers_action_list(input: &[u8]) -> IResult<&[u8], Vec<&[u8]>> {
|
||||||
let (input, _) = opt(cfws)(input)?;
|
let (input, _) = opt(cfws)(input)?;
|
||||||
let (input, ret) = alt((
|
let (input, ret) = alt((
|
||||||
separated_nonempty_list(
|
separated_list1(
|
||||||
delimited(
|
delimited(
|
||||||
map(opt(cfws), |_| ()),
|
map(opt(cfws), |_| ()),
|
||||||
map(is_a(", "), |_| ()),
|
map(is_a(", "), |_| ()),
|
||||||
|
@ -1954,7 +1974,7 @@ pub mod encodings {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn encoded_word_list(input: &[u8]) -> IResult<&[u8], SmallVec<[u8; 64]>> {
|
pub fn encoded_word_list(input: &[u8]) -> IResult<&[u8], SmallVec<[u8; 64]>> {
|
||||||
let (input, list) = separated_nonempty_list(space, encoded_word)(input)?;
|
let (input, list) = separated_list1(space, encoded_word)(input)?;
|
||||||
let list_len = list.iter().fold(0, |mut acc, x| {
|
let list_len = list.iter().fold(0, |mut acc, x| {
|
||||||
acc += x.len();
|
acc += x.len();
|
||||||
acc
|
acc
|
||||||
|
|
|
@ -28,7 +28,8 @@ use melib::nom::{
|
||||||
bytes::complete::{is_a, is_not, tag, take_until},
|
bytes::complete::{is_a, is_not, tag, take_until},
|
||||||
character::complete::{digit1, not_line_ending},
|
character::complete::{digit1, not_line_ending},
|
||||||
combinator::{map, map_res},
|
combinator::{map, map_res},
|
||||||
multi::separated_list,
|
error::Error as NomError,
|
||||||
|
multi::separated_list1,
|
||||||
sequence::{pair, preceded, separated_pair},
|
sequence::{pair, preceded, separated_pair},
|
||||||
IResult,
|
IResult,
|
||||||
};
|
};
|
||||||
|
@ -72,7 +73,10 @@ macro_rules! define_commands {
|
||||||
|
|
||||||
pub fn quoted_argument(input: &[u8]) -> IResult<&[u8], &str> {
|
pub fn quoted_argument(input: &[u8]) -> IResult<&[u8], &str> {
|
||||||
if input.is_empty() {
|
if input.is_empty() {
|
||||||
return Err(nom::Err::Error((input, nom::error::ErrorKind::Tag)));
|
return Err(nom::Err::Error(NomError {
|
||||||
|
input,
|
||||||
|
code: nom::error::ErrorKind::Tag,
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
if input[0] == b'"' {
|
if input[0] == b'"' {
|
||||||
|
@ -85,7 +89,10 @@ pub fn quoted_argument(input: &[u8]) -> IResult<&[u8], &str> {
|
||||||
}
|
}
|
||||||
i += 1;
|
i += 1;
|
||||||
}
|
}
|
||||||
Err(nom::Err::Error((input, nom::error::ErrorKind::Tag)))
|
Err(nom::Err::Error(NomError {
|
||||||
|
input,
|
||||||
|
code: nom::error::ErrorKind::Tag,
|
||||||
|
}))
|
||||||
} else {
|
} else {
|
||||||
map_res(is_not(" "), std::str::from_utf8)(input)
|
map_res(is_not(" "), std::str::from_utf8)(input)
|
||||||
}
|
}
|
||||||
|
@ -243,7 +250,10 @@ fn eof(input: &[u8]) -> IResult<&[u8], ()> {
|
||||||
if input.is_empty() {
|
if input.is_empty() {
|
||||||
Ok((input, ()))
|
Ok((input, ()))
|
||||||
} else {
|
} else {
|
||||||
Err(nom::Err::Error((input, nom::error::ErrorKind::Tag)))
|
Err(nom::Err::Error(NomError {
|
||||||
|
input,
|
||||||
|
code: nom::error::ErrorKind::Tag,
|
||||||
|
}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -502,7 +512,7 @@ define_commands!([
|
||||||
let (input, _) = is_a(" ")(input)?;
|
let (input, _) = is_a(" ")(input)?;
|
||||||
let (input, bin) = quoted_argument(input)?;
|
let (input, bin) = quoted_argument(input)?;
|
||||||
let (input, _) = is_a(" ")(input)?;
|
let (input, _) = is_a(" ")(input)?;
|
||||||
let (input, args) = separated_list(is_a(" "), quoted_argument)(input)?;
|
let (input, args) = separated_list1(is_a(" "), quoted_argument)(input)?;
|
||||||
let (input, _) = eof(input)?;
|
let (input, _) = eof(input)?;
|
||||||
Ok((input, {
|
Ok((input, {
|
||||||
View(Pipe(bin.to_string(), args.into_iter().map(String::from).collect::<Vec<String>>()))
|
View(Pipe(bin.to_string(), args.into_iter().map(String::from).collect::<Vec<String>>()))
|
||||||
|
|
|
@ -51,7 +51,7 @@ fn main() -> Result<()> {
|
||||||
Err(melib::nom::Err::Error(err)) => {
|
Err(melib::nom::Err::Error(err)) => {
|
||||||
println!(
|
println!(
|
||||||
"Error in parsing {:?}",
|
"Error in parsing {:?}",
|
||||||
unsafe { std::str::from_utf8_unchecked(err.0) }
|
unsafe { std::str::from_utf8_unchecked(err.input) }
|
||||||
.chars()
|
.chars()
|
||||||
.take(150)
|
.take(150)
|
||||||
.collect::<String>()
|
.collect::<String>()
|
||||||
|
|
Loading…
Reference in New Issue