diff --git a/flake.lock b/flake.lock index f64cb7a..1f5b985 100644 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1751949589, - "narHash": "sha256-mgFxAPLWw0Kq+C8P3dRrZrOYEQXOtKuYVlo9xvPntt8=", + "lastModified": 1752446735, + "narHash": "sha256-Nz2vtUEaRB/UjvPfuhHpez060P/4mvGpXW4JCDIboA4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9b008d60392981ad674e04016d25619281550a9d", + "rev": "a421ac6595024edcfbb1ef950a3712b89161c359", "type": "github" }, "original": { diff --git a/src/app/commands.rs b/src/app/commands.rs index 1fe20ce..07ef9ab 100644 --- a/src/app/commands.rs +++ b/src/app/commands.rs @@ -84,14 +84,13 @@ where let image_for_selected_line = self.image_from_line(line, &document_text).ok_or_else(|| { Error::parse_error().with_message(format!( - "unable to retrieve image for the selected line: {}", - line + "unable to retrieve image for the selected line: {line}" )) })?; self.show_message( MessageType::INFO, - format!("Starting scan of {}...", image_for_selected_line).as_str(), + format!("Starting scan of {image_for_selected_line}...").as_str(), ) .await; @@ -102,7 +101,7 @@ where self.show_message( MessageType::INFO, - format!("Finished scan of {}.", image_for_selected_line).as_str(), + format!("Finished scan of {image_for_selected_line}.").as_str(), ) .await; @@ -178,7 +177,7 @@ where self.show_message( MessageType::INFO, - format!("Starting build of {}...", uri_without_file_path).as_str(), + format!("Starting build of {uri_without_file_path}...").as_str(), ) .await; diff --git a/src/app/lsp_server.rs b/src/app/lsp_server.rs index a8c3f36..b698b7d 100644 --- a/src/app/lsp_server.rs +++ b/src/app/lsp_server.rs @@ -45,7 +45,7 @@ where async fn initialize_component_factory_with(&self, config: &Value) -> Result<()> { let Ok(config) = serde_json::from_value::(config.clone()) else { return Err(Error::internal_error() - .with_message(format!("unable to transform json into config: {}", config))); + .with_message(format!("unable to transform json into config: {config}"))); }; debug!("updating with configuration: {config:?}"); @@ -78,7 +78,7 @@ impl TryFrom<&str> for SupportedCommands { match value { "sysdig-lsp.execute-scan" => Ok(SupportedCommands::ExecuteBaseImageScan), "sysdig-lsp.execute-build-and-scan" => Ok(SupportedCommands::ExecuteBuildAndScan), - _ => Err(format!("command not supported: {}", value)), + _ => Err(format!("command not supported: {value}")), } } } @@ -264,7 +264,7 @@ where async fn execute_command(&self, params: ExecuteCommandParams) -> Result> { let command: SupportedCommands = params.command.as_str().try_into().map_err(|e| { - Error::internal_error().with_message(format!("unable to parse command: {}", e)) + Error::internal_error().with_message(format!("unable to parse command: {e}")) })?; let result = match command { @@ -355,10 +355,10 @@ async fn execute_command_build_and_scan( let mut factory = server.component_factory.write().await; let image_scanner = factory.image_scanner().map_err(|e| { - Error::internal_error().with_message(format!("unable to create image scanner: {}", e)) + Error::internal_error().with_message(format!("unable to create image scanner: {e}")) })?; let image_builder = factory.image_builder().map_err(|e| { - Error::internal_error().with_message(format!("unable to create image builder: {}", e)) + Error::internal_error().with_message(format!("unable to create image builder: {e}")) })?; (image_scanner, image_builder) diff --git a/src/infra/lsp_logger.rs b/src/infra/lsp_logger.rs index 58f2d2f..6b424c5 100644 --- a/src/infra/lsp_logger.rs +++ b/src/infra/lsp_logger.rs @@ -55,6 +55,6 @@ impl tracing::field::Visit for StringVisitor { if !self.message.is_empty() { self.message.push(' '); } - self.message.push_str(&format!("{:?}", value)); + self.message.push_str(&format!("{value:?}")); } } diff --git a/src/infra/scanner_binary_manager.rs b/src/infra/scanner_binary_manager.rs index 0dc0350..3d77790 100644 --- a/src/infra/scanner_binary_manager.rs +++ b/src/infra/scanner_binary_manager.rs @@ -177,7 +177,7 @@ impl ScannerBinaryManager { fn binary_path_for_version(&self, version: &Version) -> PathBuf { let mut cache_dir = dirs::cache_dir().unwrap_or_else(|| PathBuf::from(".")); cache_dir.push("sysdig-cli-scanner"); - cache_dir.push(format!("sysdig-cli-scanner.{}", version)); + cache_dir.push(format!("sysdig-cli-scanner.{version}")); cache_dir } }