Skip to content

Commit f4c30ae

Browse files
committed
Update regex-capi, format-args
* Update edition and set MSRV for regex-capi * Inline a few format-args in the same crate
1 parent 2695e29 commit f4c30ae

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

regex-capi/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ description = """
1111
A C API for Rust's regular expression library.
1212
"""
1313
workspace = ".."
14-
edition = "2018"
14+
edition = "2021"
15+
rust-version = "1.65"
1516

1617
[lib]
1718
name = "rure"

regex-capi/src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ ffi_fn! {
6060
ffi_fn! {
6161
fn rure_error_message(err: *mut Error) -> *const c_char {
6262
let err = unsafe { &mut *err };
63-
let cmsg = match CString::new(format!("{}", err)) {
63+
let cmsg = match CString::new(format!("{err}")) {
6464
Ok(msg) => msg,
6565
Err(err) => {
6666
// I guess this can probably happen if the regex itself has a

regex-capi/src/macros.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ macro_rules! ffi_fn {
2020
};
2121
let _ = writeln!(
2222
&mut io::stderr(),
23-
"panic unwind caught, aborting: {:?}",
24-
msg);
23+
"panic unwind caught, aborting: {msg:?}"
24+
);
2525
unsafe { abort() }
2626
}
2727
}

regex-capi/src/rure.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ ffi_fn! {
8282
let re = rure_compile(
8383
pat, len, RURE_DEFAULT_FLAGS, ptr::null(), &mut err);
8484
if err.is_err() {
85-
let _ = writeln!(&mut io::stderr(), "{}", err);
85+
let _ = writeln!(&mut io::stderr(), "{err}");
8686
let _ = writeln!(
8787
&mut io::stderr(), "aborting from rure_compile_must");
8888
unsafe { abort() }
@@ -579,7 +579,7 @@ ffi_fn! {
579579
let mut err = Error::new(ErrorKind::None);
580580
let esc = rure_escape(pat, len, &mut err);
581581
if err.is_err() {
582-
let _ = writeln!(&mut io::stderr(), "{}", err);
582+
let _ = writeln!(&mut io::stderr(), "{err}");
583583
let _ = writeln!(
584584
&mut io::stderr(), "aborting from rure_escape_must");
585585
unsafe { abort() }

0 commit comments

Comments
 (0)