Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions src/app/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand Down Expand Up @@ -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;

Expand Down
10 changes: 5 additions & 5 deletions src/app/lsp_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ where
async fn initialize_component_factory_with(&self, config: &Value) -> Result<()> {
let Ok(config) = serde_json::from_value::<Config>(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:?}");
Expand Down Expand Up @@ -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}")),
}
}
}
Expand Down Expand Up @@ -264,7 +264,7 @@ where

async fn execute_command(&self, params: ExecuteCommandParams) -> Result<Option<Value>> {
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 {
Expand Down Expand Up @@ -355,10 +355,10 @@ async fn execute_command_build_and_scan<C: LSPClient>(
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)
Expand Down
2 changes: 1 addition & 1 deletion src/infra/lsp_logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:?}"));
}
}
2 changes: 1 addition & 1 deletion src/infra/scanner_binary_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down