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
|
@ -715,10 +715,10 @@ impl Platform for MacPlatform {
|
|||
let urls = panel.URLs();
|
||||
for i in 0..urls.count() {
|
||||
let url = urls.objectAtIndex(i);
|
||||
if url.isFileURL() == YES {
|
||||
if let Ok(path) = ns_url_to_path(url) {
|
||||
result.push(path)
|
||||
}
|
||||
if url.isFileURL() == YES
|
||||
&& let Ok(path) = ns_url_to_path(url)
|
||||
{
|
||||
result.push(path)
|
||||
}
|
||||
}
|
||||
Some(result)
|
||||
|
@ -786,15 +786,16 @@ impl Platform for MacPlatform {
|
|||
// This is conditional on OS version because I'd like to get rid of it, so that
|
||||
// you can manually create a file called `a.sql.s`. That said it seems better
|
||||
// to break that use-case than breaking `a.sql`.
|
||||
if chunks.len() == 3 && chunks[1].starts_with(chunks[2]) {
|
||||
if Self::os_version() >= SemanticVersion::new(15, 0, 0) {
|
||||
let new_filename = OsStr::from_bytes(
|
||||
&filename.as_bytes()
|
||||
[..chunks[0].len() + 1 + chunks[1].len()],
|
||||
)
|
||||
.to_owned();
|
||||
result.set_file_name(&new_filename);
|
||||
}
|
||||
if chunks.len() == 3
|
||||
&& chunks[1].starts_with(chunks[2])
|
||||
&& Self::os_version() >= SemanticVersion::new(15, 0, 0)
|
||||
{
|
||||
let new_filename = OsStr::from_bytes(
|
||||
&filename.as_bytes()
|
||||
[..chunks[0].len() + 1 + chunks[1].len()],
|
||||
)
|
||||
.to_owned();
|
||||
result.set_file_name(&new_filename);
|
||||
}
|
||||
return result;
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue