From 429c382f608dcf298931ce679e30ae1e6b702c37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Wed, 16 Mar 2022 08:01:36 +0100 Subject: roezio: Update nom from 4 to 7.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- src/lib.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 1f4dea46..78ced5a8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,7 +1,6 @@ -extern crate pyo3; -#[macro_use] -extern crate nom; extern crate ncurses; +extern crate nom; +extern crate pyo3; #[macro_use] extern crate lazy_static; extern crate enum_set; @@ -33,14 +32,14 @@ macro_rules! py_object { }; } -fn nom_to_py_err(py: Python, err: nom::Err<&str>) -> PyErr { - LogParseError::new_err(py_object!(py, err.into_error_kind().description())) +fn nom_to_py_err(py: Python, err: nom::Err>) -> PyErr { + LogParseError::new_err(py_object!(py, err.to_string())) } #[pyfunction] fn to_curses_attr(py: Python, fg: i16, bg: i16, attrs: &str) -> PyResult { let attrs = match parse_attrs(attrs) { - Ok(attrs) => attrs.1, + Ok(attrs) => attrs, Err(err) => return Err(nom_to_py_err(py, err)), }; let result = curses_attr(fg, bg, attrs); -- cgit v1.2.3