diff --git a/src/apperr.rs b/src/apperr.rs index adb0147..05dd251 100644 --- a/src/apperr.rs +++ b/src/apperr.rs @@ -31,7 +31,7 @@ impl Error { pub fn message(&self) -> String { match *self { APP_ICU_MISSING => loc(LocId::ErrorIcuMissing).to_string(), - Error::App(code) => format!("Unknown app error code: {}", code), + Error::App(code) => format!("Unknown app error code: {code}"), Error::Icu(code) => icu::apperr_format(code), Error::Sys(code) => sys::apperr_format(code), } diff --git a/src/buffer.rs b/src/buffer.rs index 95ebf2b..22a408e 100644 --- a/src/buffer.rs +++ b/src/buffer.rs @@ -1046,7 +1046,7 @@ impl TextBuffer { options: SearchOptions, ) -> apperr::Result { let sanitized_pattern = if options.whole_word && options.use_regex { - Cow::Owned(format!(r"\b(?:{})\b", pattern)) + Cow::Owned(format!(r"\b(?:{pattern})\b")) } else if options.whole_word { let mut p = String::with_capacity(pattern.len() + 16); p.push_str(r"\b"); diff --git a/src/icu.rs b/src/icu.rs index 465eb44..2a2fa3f 100644 --- a/src/icu.rs +++ b/src/icu.rs @@ -57,9 +57,9 @@ pub fn apperr_format(code: u32) -> String { let msg = format(code); if !msg.is_empty() { - format!("ICU Error: {}", msg) + format!("ICU Error: {msg}") } else { - format!("ICU Error: {:#08x}", code) + format!("ICU Error: {code:#08x}") } } @@ -118,7 +118,7 @@ impl<'pivot> Converter<'pivot> { } fn append_nul(input: &str) -> String { - format!("{}\0", input) + format!("{input}\0") } pub fn convert( diff --git a/src/sys/unix.rs b/src/sys/unix.rs index dd0b642..a9be74f 100644 --- a/src/sys/unix.rs +++ b/src/sys/unix.rs @@ -274,7 +274,7 @@ pub fn read_stdin(mut timeout: time::Duration) -> Option { STATE.inject_resize = false; let (w, h) = get_window_size(); if w > 0 && h > 0 { - result = format!("\x1b[8;{};{}t{}", h, w, result); + result = format!("\x1b[8;{h};{w}t{result}"); } } @@ -459,7 +459,7 @@ pub fn icu_proc_suffix(handle: NonNull) -> String { let version = &path[suffix_start..]; let version_end = version.find('.').unwrap_or(version.len()); let version = &version[..version_end]; - format!("_{}", version) + format!("_{version}") } } @@ -468,7 +468,7 @@ pub fn add_icu_proc_suffix<'a>(name: &'a CStr, suffix: &str) -> Cow<'a, CStr> { Cow::Borrowed(name) } else { let name = unsafe { name.to_str().unwrap_unchecked() }; - let combined = format!("{}{}\0", name, suffix); + let combined = format!("{name}{suffix}\0"); let combined = unsafe { CString::from_vec_unchecked(combined.into_bytes()) }; Cow::Owned(combined) } @@ -496,7 +496,7 @@ pub fn io_error_to_apperr(err: std::io::Error) -> apperr::Error { } pub fn apperr_format(code: u32) -> String { - let mut result = format!("Error {}", code); + let mut result = format!("Error {code}"); unsafe { let ptr = libc::strerror(code as i32); diff --git a/src/sys/windows.rs b/src/sys/windows.rs index 0281821..c01cbf3 100644 --- a/src/sys/windows.rs +++ b/src/sys/windows.rs @@ -594,7 +594,7 @@ pub fn apperr_format(code: u32) -> String { null_mut(), ); - let mut result = format!("Error {:#08x}", code); + let mut result = format!("Error {code:#08x}"); if len > 0 { let msg = helpers::str_from_raw_parts(ptr, len as usize); diff --git a/src/tui.rs b/src/tui.rs index 010b63d..b5cd2ab 100644 --- a/src/tui.rs +++ b/src/tui.rs @@ -761,7 +761,7 @@ impl Tui { result.push_str("general:\r\n- focus_path:\r\n"); for &id in self.focused_node_path.iter().rev() { - _ = write!(result, " - {:016x}\r\n", id); + _ = write!(result, " - {id:016x}\r\n"); } result.push_str("\r\ntree:\r\n");