Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix(desktop-gpui): drop unsafe blocks objc2 0.6 no longer needs and pin the Ask first label

Richie McIlroya5e71e2464a5
diff --git a/apps/desktop-gpui/src/i18n/tests.rs b/apps/desktop-gpui/src/i18n/tests.rs
index d88dd7fe2..ddae54d5f 100644
--- a/apps/desktop-gpui/src/i18n/tests.rs
+++ b/apps/desktop-gpui/src/i18n/tests.rs
@@ -428,7 +428,7 @@ fn english_matches_the_literals_it_replaced() {
),
(
tr::settings::general::updates::download_policy::manual(),
- "Manual".into(),
+ "Ask first".into(),
),
(
tr::settings::general::updates::download_policy::auto(),
diff --git a/apps/desktop-gpui/src/platform.rs b/apps/desktop-gpui/src/platform.rs
index e24b9d1d5..21f1fa4d3 100644
--- a/apps/desktop-gpui/src/platform.rs
+++ b/apps/desktop-gpui/src/platform.rs
@@ -655,8 +655,7 @@ mod mac {
use objc2_foundation::{NSNotification, NSOperationQueue};
let reduce_motion = || {
- let reduce =
- unsafe { NSWorkspace::sharedWorkspace().accessibilityDisplayShouldReduceMotion() };
+ let reduce = NSWorkspace::sharedWorkspace().accessibilityDisplayShouldReduceMotion();
tracing::debug!(reduce, "system reduce motion");
reduce
};
@@ -1039,9 +1038,7 @@ mod mac {
NSAppearance::appearanceNamed(unsafe { NSAppearanceNameDarkAqua })
}
};
- unsafe {
- NSAppearanceCustomization::setAppearance(&*native.0, named.as_deref());
- }
+ NSAppearanceCustomization::setAppearance(&*native.0, named.as_deref());
}
pub fn window_is_dark(window: &Window) -> Option<bool> {
@@ -1052,8 +1049,8 @@ mod mac {
};
let ns = ns_window(window)?;
- let effective = unsafe { NSAppearanceCustomization::effectiveAppearance(&*ns) };
- let name = unsafe { effective.name() };
+ let effective = NSAppearanceCustomization::effectiveAppearance(&*ns);
+ let name = effective.name();
Some(unsafe {
name.isEqualToString(NSAppearanceNameDarkAqua)
|| name.isEqualToString(NSAppearanceNameVibrantDark)