From e3ce88f6f25901b1d33fbc5f931a9d8f90b9e2b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Fri, 18 Jun 2021 14:40:51 +0300 Subject: Minor clippy perf fixes --- crates/project_model/src/build_data.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/project_model/src/build_data.rs') diff --git a/crates/project_model/src/build_data.rs b/crates/project_model/src/build_data.rs index 53cb4bae7..a76f25a8c 100644 --- a/crates/project_model/src/build_data.rs +++ b/crates/project_model/src/build_data.rs @@ -187,7 +187,7 @@ impl WorkspaceBuildData { let mut deserializer = serde_json::Deserializer::from_str(line); deserializer.disable_recursion_limit(); let message = Message::deserialize(&mut deserializer) - .unwrap_or(Message::TextLine(line.to_string())); + .unwrap_or_else(|_| Message::TextLine(line.to_string())); match message { Message::BuildScriptExecuted(BuildScript { -- cgit v1.2.3 From 6b1f0057f2dbe48f1c59c8938957daf158e30823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Fri, 18 Jun 2021 14:44:36 +0300 Subject: Avoid string allocation --- crates/project_model/src/build_data.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/project_model/src/build_data.rs') diff --git a/crates/project_model/src/build_data.rs b/crates/project_model/src/build_data.rs index a76f25a8c..45bbb08dc 100644 --- a/crates/project_model/src/build_data.rs +++ b/crates/project_model/src/build_data.rs @@ -229,7 +229,7 @@ impl WorkspaceBuildData { Message::CompilerArtifact(message) => { progress(format!("metadata {}", message.target.name)); - if message.target.kind.contains(&"proc-macro".to_string()) { + if message.target.kind.iter().any(|k| k == "proc-macro") { let package_id = message.package_id; // Skip rmeta file if let Some(filename) = -- cgit v1.2.3