Auto-fix clippy::collapsible_if violations (#36428)
Release Notes: - N/A
This commit is contained in:
parent
9e8ec72bd5
commit
8f567383e4
281 changed files with 6628 additions and 7089 deletions
|
@ -543,27 +543,27 @@ impl KeymapFile {
|
|||
//
|
||||
// When a struct with no deserializable fields is added by deriving `Action`, an empty
|
||||
// object schema is produced. The action should be invoked without data in this case.
|
||||
if let Some(schema) = action_schema {
|
||||
if schema != empty_object {
|
||||
let mut matches_action_name = json_schema!({
|
||||
"const": name
|
||||
});
|
||||
if let Some(desc) = description.clone() {
|
||||
add_description(&mut matches_action_name, desc);
|
||||
}
|
||||
if let Some(message) = deprecation_messages.get(name) {
|
||||
add_deprecation(&mut matches_action_name, message.to_string());
|
||||
} else if let Some(new_name) = deprecation {
|
||||
add_deprecation_preferred_name(&mut matches_action_name, new_name);
|
||||
}
|
||||
let action_with_input = json_schema!({
|
||||
"type": "array",
|
||||
"items": [matches_action_name, schema],
|
||||
"minItems": 2,
|
||||
"maxItems": 2
|
||||
});
|
||||
keymap_action_alternatives.push(action_with_input);
|
||||
if let Some(schema) = action_schema
|
||||
&& schema != empty_object
|
||||
{
|
||||
let mut matches_action_name = json_schema!({
|
||||
"const": name
|
||||
});
|
||||
if let Some(desc) = description.clone() {
|
||||
add_description(&mut matches_action_name, desc);
|
||||
}
|
||||
if let Some(message) = deprecation_messages.get(name) {
|
||||
add_deprecation(&mut matches_action_name, message.to_string());
|
||||
} else if let Some(new_name) = deprecation {
|
||||
add_deprecation_preferred_name(&mut matches_action_name, new_name);
|
||||
}
|
||||
let action_with_input = json_schema!({
|
||||
"type": "array",
|
||||
"items": [matches_action_name, schema],
|
||||
"minItems": 2,
|
||||
"maxItems": 2
|
||||
});
|
||||
keymap_action_alternatives.push(action_with_input);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -593,10 +593,10 @@ impl KeymapFile {
|
|||
match fs.load(paths::keymap_file()).await {
|
||||
result @ Ok(_) => result,
|
||||
Err(err) => {
|
||||
if let Some(e) = err.downcast_ref::<std::io::Error>() {
|
||||
if e.kind() == std::io::ErrorKind::NotFound {
|
||||
return Ok(crate::initial_keymap_content().to_string());
|
||||
}
|
||||
if let Some(e) = err.downcast_ref::<std::io::Error>()
|
||||
&& e.kind() == std::io::ErrorKind::NotFound
|
||||
{
|
||||
return Ok(crate::initial_keymap_content().to_string());
|
||||
}
|
||||
Err(err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue