Finds a way to keep nom 6

pull/82/head
Tpt 4 years ago
parent d8773ec51c
commit ddbef60de0
  1. 3
      lib/Cargo.toml
  2. 8
      lib/src/model/xsd/parser.rs
  3. 2
      lib/src/store/sophia.rs

@ -37,7 +37,8 @@ rio_api = "0.5"
rio_turtle = "0.5"
rio_xml = "0.5"
hex = "0.4"
nom = "5"
nom = "6"
funty="=1.1.0"
peg = "0.6"
siphasher = "0.3"
lasso = {version="0.4", features=["multi-threaded", "inline-more"]}

@ -146,7 +146,7 @@ const OVERFLOW_ERROR: XsdParseError = XsdParseError {
};
pub fn parse_value<'a, T>(
f: impl Fn(&'a str) -> XsdResult<'a, T>,
mut f: impl FnMut(&'a str) -> XsdResult<'a, T>,
input: &'a str,
) -> Result<T, XsdParseError> {
let (left, result) = f(input)?;
@ -529,9 +529,9 @@ fn parsed_u8_range(input: &str, min: u8, max: u8) -> Result<u8, XsdParseError> {
}
fn map_res<'a, O1, O2, E2: Into<XsdParseError>>(
first: impl Fn(&'a str) -> XsdResult<'a, O1>,
second: impl Fn(O1) -> Result<O2, E2>,
) -> impl Fn(&'a str) -> XsdResult<'a, O2> {
mut first: impl FnMut(&'a str) -> XsdResult<'a, O1>,
mut second: impl FnMut(O1) -> Result<O2, E2>,
) -> impl FnMut(&'a str) -> XsdResult<'a, O2> {
move |input| {
let (input, o1) = first(input)?;
Ok((input, second(o1).map_err(|e| Err::Error(e.into()))?))

@ -620,7 +620,7 @@ mod rocksdb {
}
// helper functions
#[allow(clippy::unnecessary_wraps)]
fn infallible_quad_map<'a>(q: Quad) -> Result<StreamedSophiaQuad<'a>, Infallible> {
let q: SophiaQuad = q.into();
Ok(StreamedQuad::by_value(q))

Loading…
Cancel
Save