Skip to content

Commit

Permalink
Merge pull request sched-ext#1179 from devnexen/clippy_fix
Browse files Browse the repository at this point in the history
scx_utils: addressing few clippy build warnings.
  • Loading branch information
hodgesds authored Jan 11, 2025
2 parents 13c16ae + 497fa7c commit d935c7d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion rust/scx_stats/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ where
loop {
let mut line = String::new();
stream_reader.read_line(&mut line)?;
if line.len() == 0 {
if line.is_empty() {
return Ok(());
}
if exit.load(Ordering::Relaxed) {
Expand Down
2 changes: 1 addition & 1 deletion rust/scx_utils/src/compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ pub fn struct_has_field(type_name: &str, field: &str) -> Result<bool> {
}
}

return Ok(false);
Ok(false)
}

pub fn ksym_exists(ksym: &str) -> Result<bool> {
Expand Down
2 changes: 1 addition & 1 deletion rust/scx_utils/src/cpumask.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ pub struct CpumaskIterator<'a> {
index: usize,
}

impl<'a> Iterator for CpumaskIterator<'a> {
impl Iterator for CpumaskIterator<'_> {
type Item = usize;

fn next(&mut self) -> Option<Self::Item> {
Expand Down
4 changes: 2 additions & 2 deletions rust/scx_utils/src/misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::thread::sleep;
use std::time::Duration;

pub fn monitor_stats<T>(
stats_args: &Vec<(String, String)>,
stats_args: &[(String, String)],
intv: Duration,
mut should_exit: impl FnMut() -> bool,
mut output: impl FnMut(T) -> Result<()>,
Expand Down Expand Up @@ -42,7 +42,7 @@ where
retry_cnt = 0;

while !should_exit() {
let stats = match client.request::<T>("stats", stats_args.clone()) {
let stats = match client.request::<T>("stats", stats_args.to_owned()) {
Ok(v) => v,
Err(e) => match e.downcast_ref::<std::io::Error>() {
Some(ioe) => {
Expand Down

0 comments on commit d935c7d

Please sign in to comment.