Skip to content

Commit eafd5a7

Browse files
committed
Fix new warnings
1 parent 8dde3b0 commit eafd5a7

File tree

4 files changed

+9
-15
lines changed

4 files changed

+9
-15
lines changed

watchers/src/report_client.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ impl ReportClient {
4848
if e.to_string()
4949
.contains("tcp connect error: Connection refused") =>
5050
{
51-
warn!("Failed to connect on attempt #{attempt}, retrying: {}", e);
51+
warn!("Failed to connect on attempt #{attempt}, retrying: {e}");
5252

5353
tokio::time::sleep(tokio::time::Duration::from_secs(secs)).await;
5454
}
@@ -107,11 +107,7 @@ impl ReportClient {
107107
let mut data = Map::new();
108108

109109
if let Some((inserted_app_id, inserted_title)) = self.get_filtered_data(app_id, title) {
110-
trace!(
111-
"Reporting app_id: {}, title: {}",
112-
inserted_app_id,
113-
inserted_title
114-
);
110+
trace!("Reporting app_id: {inserted_app_id}, title: {inserted_title}");
115111

116112
data.insert("app".to_string(), Value::String(inserted_app_id));
117113
data.insert("title".to_string(), Value::String(inserted_title));
@@ -155,13 +151,13 @@ impl ReportClient {
155151
match filter_result {
156152
FilterResult::Replace(replacement) => {
157153
let app_id = if let Some(replace_app_id) = replacement.replace_app_id {
158-
trace!("Replacing app_id by {}", replace_app_id);
154+
trace!("Replacing app_id by {replace_app_id}");
159155
replace_app_id
160156
} else {
161157
app_id.to_string()
162158
};
163159
let title = if let Some(replace_title) = replacement.replace_title {
164-
trace!("Replacing title by {}", replace_title);
160+
trace!("Replacing title by {replace_title}");
165161
replace_title
166162
} else {
167163
title.to_string()

watchers/src/watchers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ pub async fn run_first_supported(client: Arc<ReportClient>, watcher_type: &Watch
138138
error!("Error on {watcher_type} iteration: {e}");
139139
}
140140
Err(_) => {
141-
error!("Timeout on {watcher_type} iteration after {:?}", sleep_time);
141+
error!("Timeout on {watcher_type} iteration after {sleep_time:?}");
142142
}
143143
}
144144

watchers/src/watchers/idle.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,7 @@ mod tests {
258258
assert_eq!(
259259
self.diff_seconds(*last_input_time),
260260
expected_last_input_seconds_ago,
261-
"{}",
262-
message
261+
"{message}"
263262
);
264263
} else {
265264
panic!("Expected active status");
@@ -283,10 +282,9 @@ mod tests {
283282
assert_eq!(
284283
self.diff_seconds(*last_input_time),
285284
last_input_ago,
286-
"{}",
287-
message
285+
"{message}"
288286
);
289-
assert_eq!(duration.num_seconds(), last_input_ago, "{}", message);
287+
assert_eq!(duration.num_seconds(), last_input_ago, "{message}");
290288
} else {
291289
panic!("Expected idle status");
292290
}

watchers/src/watchers/wl_foreign_toplevel_management.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl Dispatch<ZwlrForeignToplevelHandleV1, ()> for ToplevelState {
9292
window.app_id = app_id;
9393
}
9494
HandleEvent::State { state } => {
95-
trace!("State is changed for {id}: {:?}", state);
95+
trace!("State is changed for {id}: {state:?}");
9696
if state.contains(&(HandleState::Activated as u8)) {
9797
trace!("Window is activated: {id}");
9898
toplevel_state.current_window_id = Some(id);

0 commit comments

Comments
 (0)