Skip to content

Commit

Permalink
fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
Nugine committed Dec 26, 2022
1 parent c8f1336 commit aace178
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions examples/nofile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u64> {
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)
}
}
Expand All @@ -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))]
Expand Down

0 comments on commit aace178

Please sign in to comment.