Skip to content

Commit ba59503

Browse files
committed
fix(desktop): fix test CI
1 parent aa96c9f commit ba59503

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/desktop.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ trait SystemdManger {
870870
#[cfg(all(test, not(windows)))]
871871
mod tests {
872872
use super::*;
873-
use std::{env, fs, path::Path, path::PathBuf};
873+
use std::{env, fs, path::Path};
874874
use tempfile::tempdir;
875875

876876
struct EnvVarGuard {
@@ -881,17 +881,17 @@ mod tests {
881881
impl EnvVarGuard {
882882
fn set(key: &'static str, value: &Path) -> Self {
883883
let original = env::var(key).ok();
884-
std::env::set_var(key, value);
884+
unsafe { std::env::set_var(key, value) };
885885
Self { key, original }
886886
}
887887
}
888888

889889
impl Drop for EnvVarGuard {
890890
fn drop(&mut self) {
891891
if let Some(ref original) = self.original {
892-
std::env::set_var(self.key, original);
892+
unsafe { std::env::set_var(self.key, original) };
893893
} else {
894-
std::env::remove_var(self.key);
894+
unsafe { std::env::remove_var(self.key) };
895895
}
896896
}
897897
}
@@ -1108,7 +1108,10 @@ Icon=vmware-workstation\n\
11081108
let resolved = resolve_desktop_entry(&mut cache, &ctx, &DesktopResolveOptions::default());
11091109
assert!(resolved.icon().is_some());
11101110
assert!(resolved.exec().is_some());
1111-
assert_eq!(resolved.startup_wm_class(), Some(&format!("crx_{}", id)));
1111+
assert_eq!(
1112+
resolved.startup_wm_class(),
1113+
Some(format!("crx_{}", id).as_str())
1114+
);
11121115
}
11131116

11141117
#[test]

0 commit comments

Comments
 (0)