From aace1784cb06c0905f662465d554e311e65b8774 Mon Sep 17 00:00:00 2001 From: Nugine Date: Mon, 26 Dec 2022 13:17:10 +0800 Subject: [PATCH] fix clippy lints --- examples/nofile.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/nofile.rs b/examples/nofile.rs index 5be60be..ddc650a 100644 --- a/examples/nofile.rs +++ b/examples/nofile.rs @@ -10,14 +10,14 @@ mod unix_limits { /// Try to increase NOFILE limit and return the current soft limit. pub fn increase_nofile_limit() -> io::Result { let (soft, hard) = Resource::NOFILE.get()?; - println!("Before increasing: soft = {}, hard = {}", soft, hard); + println!("Before increasing: soft = {soft}, hard = {hard}"); let target = cmp::min(DEFAULT_NOFILE_LIMIT, hard); - println!("Try to increase: target = {}", target); + println!("Try to increase: target = {target}"); Resource::NOFILE.set(target, hard)?; let (soft, hard) = Resource::NOFILE.get()?; - println!("After increasing: soft = {}, hard = {}", soft, hard); + println!("After increasing: soft = {soft}, hard = {hard}"); Ok(soft) } } @@ -26,8 +26,8 @@ fn main() { #[cfg(unix)] { match unix_limits::increase_nofile_limit() { - Ok(soft) => println!("NOFILE limit: soft = {}", soft), - Err(err) => println!("Failed to increase NOFILE limit: {}", err), + Ok(soft) => println!("NOFILE limit: soft = {soft}"), + Err(err) => println!("Failed to increase NOFILE limit: {err}"), } } #[cfg(not(unix))]