Fix a bunch of other low-hanging style lints (#36498)
- **Fix a bunch of low hanging style lints like unnecessary-return** - **Fix single worktree violation** - **And the rest** Release Notes: - N/A
This commit is contained in:
@@ -311,9 +311,8 @@ unsafe fn parse_keystroke(native_event: id) -> Keystroke {
|
||||
let mut shift = modifiers.contains(NSEventModifierFlags::NSShiftKeyMask);
|
||||
let command = modifiers.contains(NSEventModifierFlags::NSCommandKeyMask);
|
||||
let function = modifiers.contains(NSEventModifierFlags::NSFunctionKeyMask)
|
||||
&& first_char.map_or(true, |ch| {
|
||||
!(NSUpArrowFunctionKey..=NSModeSwitchFunctionKey).contains(&ch)
|
||||
});
|
||||
&& first_char
|
||||
.is_none_or(|ch| !(NSUpArrowFunctionKey..=NSModeSwitchFunctionKey).contains(&ch));
|
||||
|
||||
#[allow(non_upper_case_globals)]
|
||||
let key = match first_char {
|
||||
|
||||
@@ -797,7 +797,7 @@ impl Platform for MacPlatform {
|
||||
.to_owned();
|
||||
result.set_file_name(&new_filename);
|
||||
}
|
||||
return result;
|
||||
result
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -319,7 +319,7 @@ impl MacTextSystemState {
|
||||
fn is_emoji(&self, font_id: FontId) -> bool {
|
||||
self.postscript_names_by_font_id
|
||||
.get(&font_id)
|
||||
.map_or(false, |postscript_name| {
|
||||
.is_some_and(|postscript_name| {
|
||||
postscript_name == "AppleColorEmoji" || postscript_name == ".AppleColorEmojiUI"
|
||||
})
|
||||
}
|
||||
|
||||
@@ -653,7 +653,7 @@ impl MacWindow {
|
||||
.and_then(|titlebar| titlebar.traffic_light_position),
|
||||
transparent_titlebar: titlebar
|
||||
.as_ref()
|
||||
.map_or(true, |titlebar| titlebar.appears_transparent),
|
||||
.is_none_or(|titlebar| titlebar.appears_transparent),
|
||||
previous_modifiers_changed_event: None,
|
||||
keystroke_for_do_command: None,
|
||||
do_command_handled: None,
|
||||
@@ -688,7 +688,7 @@ impl MacWindow {
|
||||
});
|
||||
}
|
||||
|
||||
if titlebar.map_or(true, |titlebar| titlebar.appears_transparent) {
|
||||
if titlebar.is_none_or(|titlebar| titlebar.appears_transparent) {
|
||||
native_window.setTitlebarAppearsTransparent_(YES);
|
||||
native_window.setTitleVisibility_(NSWindowTitleVisibility::NSWindowTitleHidden);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user