Fix case-sensitive extension check

This commit is contained in:
Javier Alvarez 2020-12-23 16:31:04 +01:00
parent 61f3d9d46b
commit 1527fb61b9

View File

@ -44,7 +44,9 @@ fn third_party_crates() -> String {
};
if let Some(name) = path.file_name().and_then(OsStr::to_str) {
for dep in CRATES {
if name.starts_with(&format!("lib{}-", dep)) && name.ends_with(".rlib") {
if name.starts_with(&format!("lib{}-", dep))
&& name.rsplit('.').next().map(|ext| ext.eq_ignore_ascii_case("rlib")) == Some(true)
{
if let Some(old) = crates.insert(dep, path.clone()) {
panic!("Found multiple rlibs for crate `{}`: `{:?}` and `{:?}", dep, old, path);
}