diff --git a/crates/ruff_python_semantic/src/binding.rs b/crates/ruff_python_semantic/src/binding.rs index 75841038f9..833ad4effe 100644 --- a/crates/ruff_python_semantic/src/binding.rs +++ b/crates/ruff_python_semantic/src/binding.rs @@ -272,14 +272,6 @@ impl<'a> FromIterator> for Bindings<'a> { } } -#[derive(Debug, Clone)] -pub struct StarImport<'a> { - /// The level of the import. `None` or `Some(0)` indicate an absolute import. - pub level: Option, - /// The module being imported. `None` indicates a wildcard import. - pub module: Option<&'a str>, -} - #[derive(Debug, Clone)] pub struct Export<'a> { /// The names of the bindings exported via `__all__`. diff --git a/crates/ruff_python_semantic/src/lib.rs b/crates/ruff_python_semantic/src/lib.rs index e47b73ca16..3b7ce9a7a5 100644 --- a/crates/ruff_python_semantic/src/lib.rs +++ b/crates/ruff_python_semantic/src/lib.rs @@ -7,6 +7,7 @@ mod model; mod node; mod reference; mod scope; +mod star_import; pub use binding::*; pub use context::*; @@ -16,3 +17,4 @@ pub use model::*; pub use node::*; pub use reference::*; pub use scope::*; +pub use star_import::*; diff --git a/crates/ruff_python_semantic/src/scope.rs b/crates/ruff_python_semantic/src/scope.rs index 711572f861..f64148b56e 100644 --- a/crates/ruff_python_semantic/src/scope.rs +++ b/crates/ruff_python_semantic/src/scope.rs @@ -8,8 +8,9 @@ use rustpython_parser::ast; use ruff_index::{newtype_index, Idx, IndexSlice, IndexVec}; -use crate::binding::{BindingId, StarImport}; +use crate::binding::BindingId; use crate::globals::GlobalsId; +use crate::star_import::StarImport; #[derive(Debug)] pub struct Scope<'a> { diff --git a/crates/ruff_python_semantic/src/star_import.rs b/crates/ruff_python_semantic/src/star_import.rs new file mode 100644 index 0000000000..53055a53b8 --- /dev/null +++ b/crates/ruff_python_semantic/src/star_import.rs @@ -0,0 +1,7 @@ +#[derive(Debug, Clone)] +pub struct StarImport<'a> { + /// The level of the import. `None` or `Some(0)` indicate an absolute import. + pub level: Option, + /// The module being imported. `None` indicates a wildcard import. + pub module: Option<&'a str>, +}