Skip to content

Commit

Permalink
Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter554 committed Jan 1, 2025
1 parent b86211f commit 6bb7275
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repository = "https://github.com/Peter554/pyimports"
documentation = "https://docs.rs/pyimports/"
readme = "README.md"
license = "MIT"
version = "0.3.0"
version = "0.3.1"
edition = "2021"
exclude = [
".github/*",
Expand Down
20 changes: 12 additions & 8 deletions src/imports_info/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,10 @@ impl ImportsInfo {

/// Excludes typechecking imports.
pub fn exclude_typechecking_imports(&mut self) -> Result<()> {
let internal_imports = self.internal_imports_metadata.iter().filter_map(
|((from, to), metadata)| match metadata {
let internal_imports = self
.internal_imports_metadata
.iter()
.filter_map(|((from, to), metadata)| match metadata {
ImportMetadata::ExplicitImport(metadata) => {
if metadata.is_typechecking {
Some((*from, *to))
Expand All @@ -255,11 +257,13 @@ impl ImportsInfo {
}
}
ImportMetadata::ImplicitImport => None,
},
).collect::<HashSet<_>>();
})
.collect::<HashSet<_>>();

let external_imports = self.external_imports_metadata.iter().filter_map(
|((from, to), metadata)| match metadata {
let external_imports = self
.external_imports_metadata
.iter()
.filter_map(|((from, to), metadata)| match metadata {
ImportMetadata::ExplicitImport(metadata) => {
if metadata.is_typechecking {
Some((*from, to.clone()))
Expand All @@ -268,8 +272,8 @@ impl ImportsInfo {
}
}
ImportMetadata::ImplicitImport => None,
},
).collect::<HashSet<_>>();
})
.collect::<HashSet<_>>();

self.exclude_imports(internal_imports, external_imports)?;
Ok(())
Expand Down

0 comments on commit 6bb7275

Please sign in to comment.