mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-14 17:07:26 +00:00
Use matches in is_dylib
This commit is contained in:
parent
3b97220926
commit
1b8a26653f
1 changed files with 3 additions and 11 deletions
|
@ -323,16 +323,8 @@ pub fn load_extern_resources(cargo_toml: &Path, cargo_features: &CargoFeatures)
|
||||||
|
|
||||||
// FIXME: File a better way to know if it is a dylib
|
// FIXME: File a better way to know if it is a dylib
|
||||||
fn is_dylib(path: &Path) -> bool {
|
fn is_dylib(path: &Path) -> bool {
|
||||||
let ext = match path.extension().and_then(OsStr::to_str).map(|it| it.to_string().to_lowercase())
|
match path.extension().and_then(OsStr::to_str).map(|it| it.to_string().to_lowercase()) {
|
||||||
{
|
None => false,
|
||||||
None => return false,
|
Some(ext) => matches!(ext.as_str(), "dll" | "dylib" | "so"),
|
||||||
Some(ext) => ext,
|
|
||||||
};
|
|
||||||
|
|
||||||
match ext.as_str() {
|
|
||||||
"dll" => true,
|
|
||||||
"dylib" => true,
|
|
||||||
"so" => true,
|
|
||||||
_ => false,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue