mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-23 04:55:09 +00:00
Remove Int
wrapper type from parser (#7577)
## Summary This is only used for the `level` field in relative imports (e.g., `from ..foo import bar`). It seems unnecessary to use a wrapper here, so this PR changes to a `u32` directly.
This commit is contained in:
parent
6c3378edb1
commit
4d6f5ff0a7
16 changed files with 75 additions and 101 deletions
|
@ -577,7 +577,9 @@ impl<'a> Generator<'a> {
|
|||
statement!({
|
||||
self.p("from ");
|
||||
if let Some(level) = level {
|
||||
self.p(&".".repeat(level.to_usize()));
|
||||
for _ in 0..*level {
|
||||
self.p(".");
|
||||
}
|
||||
}
|
||||
if let Some(module) = module {
|
||||
self.p_id(module);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue