Move turns to a submodule of std (#6039)
* Move turns to a submodule of std Signed-off-by: Nick Cameron <nrc@ncameron.org> * Cache module infos as well as memory; fix a bug with deprecated constants Signed-off-by: Nick Cameron <nrc@ncameron.org> --------- Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
@ -1619,19 +1619,21 @@ impl ImportStatement {
|
||||
return Some(alias.name.clone());
|
||||
}
|
||||
|
||||
let mut parts = match &self.path {
|
||||
ImportPath::Kcl { filename: s } | ImportPath::Foreign { path: s } => s.split('.'),
|
||||
_ => return None,
|
||||
};
|
||||
let path = parts.next()?;
|
||||
let _ext = parts.next()?;
|
||||
let rest = parts.next();
|
||||
match &self.path {
|
||||
ImportPath::Kcl { filename: s } | ImportPath::Foreign { path: s } => {
|
||||
let mut parts = s.split('.');
|
||||
let path = parts.next()?;
|
||||
let _ext = parts.next()?;
|
||||
let rest = parts.next();
|
||||
|
||||
if rest.is_some() {
|
||||
return None;
|
||||
if rest.is_some() {
|
||||
return None;
|
||||
}
|
||||
|
||||
path.rsplit(&['/', '\\']).next().map(str::to_owned)
|
||||
}
|
||||
ImportPath::Std { path } => path.last().cloned(),
|
||||
}
|
||||
|
||||
path.rsplit(&['/', '\\']).next().map(str::to_owned)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user