chore: Fix more clippy lints

This commit is contained in:
Jonas Platte
2022-10-25 11:51:23 +02:00
committed by Jonas Platte
parent 285dc129c3
commit 50a5ec89e9
7 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ async fn bootstrap(client: Client, user_id: OwnedUserId, password: String) {
.await
.expect("Couldn't bootstrap cross signing")
} else {
panic!("Error during cross-signing bootstrap {:#?}", e);
panic!("Error during cross-signing bootstrap {e:#?}");
}
}
}
+1 -1
View File
@@ -35,7 +35,7 @@ async fn wait_for_confirmation(sas: SasVerification, emoji: [Emoji; 7]) {
}
async fn print_devices(user_id: &UserId, client: &Client) {
println!("Devices of user {}", user_id);
println!("Devices of user {user_id}");
for device in client.encryption().get_user_devices(user_id).await.unwrap().devices() {
println!(
+1 -1
View File
@@ -68,6 +68,6 @@ async fn main() -> anyhow::Result<()> {
let user_id = UserId::parse(username).expect("Couldn't parse the MXID");
let profile = get_profile(client, &user_id).await?;
println!("{:#?}", profile);
println!("{profile:#?}");
Ok(())
}
+1 -1
View File
@@ -161,7 +161,7 @@ impl MockComponent for Details {
let mut tabs = vec![];
for (title, count) in &self.state_events_counts {
tabs.push(Spans::from(format!("{}: {}", title.clone(), count)));
tabs.push(Spans::from(format!("{title}: {count}")));
}
frame.render_widget(
+1 -1
View File
@@ -41,7 +41,7 @@ impl MockComponent for StatusBar {
if let Some(dur) = self.sstate.time_to_full_sync() {
tabs.push(Spans::from(format!("Full sync: {}ms", dur.as_millis())));
if let Some(count) = self.sstate.total_rooms_count() {
tabs.push(Spans::from(format!("{} rooms", count)));
tabs.push(Spans::from(format!("{count} rooms")));
}
} else {
tabs.push(Spans::from(format!(
+4 -4
View File
@@ -192,11 +192,11 @@ async fn main() -> Result<()> {
.account()
.get_display_name()
.await?
.map(|s| format!("{} ({})", s, user_id))
.unwrap_or_else(|| format!("{}", user_id));
.map(|s| format!("{s} ({user_id})"))
.unwrap_or_else(|| format!("{user_id}"));
let poller = MatrixPoller(rx);
let mut model = Model::new(start_sync, model_tx, poller);
model.set_title(format!("{} via {}", display_name, opt.sliding_sync_proxy));
model.set_title(format!("{display_name} via {}", opt.sliding_sync_proxy));
run_ui(model).await;
Ok(())
@@ -213,7 +213,7 @@ async fn run_ui(mut model: Model) {
// Tick
match model.app.tick(PollStrategy::Once) {
Err(err) => {
model.set_title(format!("Application error: {}", err));
model.set_title(format!("Application error: {err}"));
}
Ok(messages) if !messages.is_empty() => {
// NOTE: redraw if at least one msg has been processed
+1 -1
View File
@@ -172,7 +172,7 @@ impl Printer {
let data = if self.json {
serde_json::to_string_pretty(data).expect("Can't serialize struct")
} else {
format!("{:#?}", data)
format!("{data:#?}")
};
let syntax = if self.json {