Fill-in missing implementation for is_native_module_file_name (#5410)

## Summary

This was just an oversight -- the last remaining `todo!()` that I never
filled in. We clearly don't have any test coverage for it yet, but this
mimics the Pyright implementation.
This commit is contained in:
Charlie Marsh 2023-06-28 10:50:54 -04:00 committed by GitHub
parent 979049b2a6
commit ea7bb199bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 86 additions and 23 deletions

View file

@ -64,12 +64,7 @@ pub(crate) fn find(dir_path: &Path, exclusions: &[&Path]) -> BTreeMap<String, Im
.exists()
{
// E.g., `foo.abi3.so` becomes `foo`.
let file_stem = path
.file_stem()
.and_then(OsStr::to_str)
.and_then(|file_stem| {
file_stem.split_once('.').map(|(file_stem, _)| file_stem)
});
let file_stem = native_module::native_module_name(&path);
let is_native_lib = true;
(file_stem, is_native_lib)
} else {