summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorMaxime “pep” Buquet <pep@bouah.net>2022-03-16 08:01:36 +0100
committerMaxime “pep” Buquet <pep@bouah.net>2022-08-21 17:19:58 +0200
commit429c382f608dcf298931ce679e30ae1e6b702c37 (patch)
tree724cb658da3b22479159c6051e99fae211bef362 /src/lib.rs
parent8600e053e447091a16862aa91a58ba216a052c38 (diff)
downloadpoezio-429c382f608dcf298931ce679e30ae1e6b702c37.tar.gz
poezio-429c382f608dcf298931ce679e30ae1e6b702c37.tar.bz2
poezio-429c382f608dcf298931ce679e30ae1e6b702c37.tar.xz
poezio-429c382f608dcf298931ce679e30ae1e6b702c37.zip
roezio: Update nom from 4 to 7.1
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs11
1 files changed, 5 insertions, 6 deletions
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<nom::error::Error<&str>>) -> PyErr {
+ LogParseError::new_err(py_object!(py, err.to_string()))
}
#[pyfunction]
fn to_curses_attr(py: Python, fg: i16, bg: i16, attrs: &str) -> PyResult<PyObject> {
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);