Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix(cli): gate update helpers to non-Windows for clippy

Richie McIlroy8faa0e39866a
diff --git a/apps/cli/src/update.rs b/apps/cli/src/update.rs
index c0e40147f..d78100b96 100644
--- a/apps/cli/src/update.rs
+++ b/apps/cli/src/update.rs
@@ -34,7 +34,7 @@ pub fn run(format: OutputFormat) -> Result<(), String> {
#[cfg(windows)]
{
start_windows_update()?;
- return match format {
+ match format {
OutputFormat::Json => write_json(&UpdateReport {
started: true,
completed: false,
@@ -44,7 +44,7 @@ pub fn run(format: OutputFormat) -> Result<(), String> {
println!("Cap update started. It will continue after this command exits.");
Ok(())
}
- };
+ }
}
#[cfg(not(windows))]
@@ -117,6 +117,7 @@ const fn installer_url() -> &'static str {
""
}
+#[cfg(not(windows))]
fn update_error(output: &Output) -> String {
let stderr = text(&output.stderr);
if !stderr.trim().is_empty() {
@@ -131,6 +132,7 @@ fn update_error(output: &Output) -> String {
format!("Cap update installer exited with {}", output.status)
}
+#[cfg(not(windows))]
fn print_output(output: &Output) {
let stdout = text(&output.stdout);
if !stdout.is_empty() {
@@ -143,6 +145,7 @@ fn print_output(output: &Output) {
}
}
+#[cfg(not(windows))]
fn text(bytes: &[u8]) -> String {
String::from_utf8_lossy(bytes).into_owned()
}