mirror of https://github.com/astral-sh/ruff
[ruff] Small tweak to import
As I was playing around in this file, it was much nicer to just use `cst::` everywhere, similar to what we do with `ruff_python_ast`.
This commit is contained in:
parent
cb3c3ba94d
commit
ec2720c814
|
|
@ -6,7 +6,7 @@
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use libcst_native::{ImportAlias, Name as cstName, NameOrAttribute};
|
use libcst_native as cst;
|
||||||
|
|
||||||
use ruff_python_ast::{self as ast, Expr, ModModule, Stmt};
|
use ruff_python_ast::{self as ast, Expr, ModModule, Stmt};
|
||||||
use ruff_python_codegen::Stylist;
|
use ruff_python_codegen::Stylist;
|
||||||
|
|
@ -472,8 +472,8 @@ impl<'a> Importer<'a> {
|
||||||
let mut statement = match_statement(self.locator.slice(stmt))?;
|
let mut statement = match_statement(self.locator.slice(stmt))?;
|
||||||
let import_from = match_import_from(&mut statement)?;
|
let import_from = match_import_from(&mut statement)?;
|
||||||
let aliases = match_aliases(import_from)?;
|
let aliases = match_aliases(import_from)?;
|
||||||
aliases.push(ImportAlias {
|
aliases.push(cst::ImportAlias {
|
||||||
name: NameOrAttribute::N(Box::new(cstName {
|
name: cst::NameOrAttribute::N(Box::new(cst::Name {
|
||||||
value: member,
|
value: member,
|
||||||
lpar: vec![],
|
lpar: vec![],
|
||||||
rpar: vec![],
|
rpar: vec![],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue