mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 05:15:12 +00:00
Add import insertion support to autofix capabilities (#3787)
This commit is contained in:
parent
d7113d3995
commit
01357f62e5
20 changed files with 820 additions and 265 deletions
|
@ -27,6 +27,17 @@ pub struct Alias<'a> {
|
|||
pub as_name: Option<&'a str>,
|
||||
}
|
||||
|
||||
impl<'a> Import<'a> {
|
||||
pub fn module(name: &'a str) -> Self {
|
||||
Self {
|
||||
name: Alias {
|
||||
name,
|
||||
as_name: None,
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for AnyImport<'_> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match self {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue