diff --git a/regex-capi/Cargo.toml b/regex-capi/Cargo.toml index 78867f463..5ba88782f 100644 --- a/regex-capi/Cargo.toml +++ b/regex-capi/Cargo.toml @@ -11,7 +11,8 @@ description = """ A C API for Rust's regular expression library. """ workspace = ".." -edition = "2018" +edition = "2021" +rust-version = "1.65" [lib] name = "rure" diff --git a/regex-capi/src/error.rs b/regex-capi/src/error.rs index 7b91fb9d3..c2af42084 100644 --- a/regex-capi/src/error.rs +++ b/regex-capi/src/error.rs @@ -60,7 +60,7 @@ ffi_fn! { ffi_fn! { fn rure_error_message(err: *mut Error) -> *const c_char { let err = unsafe { &mut *err }; - let cmsg = match CString::new(format!("{}", err)) { + let cmsg = match CString::new(format!("{err}")) { Ok(msg) => msg, Err(err) => { // I guess this can probably happen if the regex itself has a diff --git a/regex-capi/src/macros.rs b/regex-capi/src/macros.rs index 7807cf853..6de0b6827 100644 --- a/regex-capi/src/macros.rs +++ b/regex-capi/src/macros.rs @@ -20,8 +20,8 @@ macro_rules! ffi_fn { }; let _ = writeln!( &mut io::stderr(), - "panic unwind caught, aborting: {:?}", - msg); + "panic unwind caught, aborting: {msg:?}" + ); unsafe { abort() } } } diff --git a/regex-capi/src/rure.rs b/regex-capi/src/rure.rs index 9e17668e2..8fe697dbe 100644 --- a/regex-capi/src/rure.rs +++ b/regex-capi/src/rure.rs @@ -82,7 +82,7 @@ ffi_fn! { let re = rure_compile( pat, len, RURE_DEFAULT_FLAGS, ptr::null(), &mut err); if err.is_err() { - let _ = writeln!(&mut io::stderr(), "{}", err); + let _ = writeln!(&mut io::stderr(), "{err}"); let _ = writeln!( &mut io::stderr(), "aborting from rure_compile_must"); unsafe { abort() } @@ -579,7 +579,7 @@ ffi_fn! { let mut err = Error::new(ErrorKind::None); let esc = rure_escape(pat, len, &mut err); if err.is_err() { - let _ = writeln!(&mut io::stderr(), "{}", err); + let _ = writeln!(&mut io::stderr(), "{err}"); let _ = writeln!( &mut io::stderr(), "aborting from rure_escape_must"); unsafe { abort() }