syntax: return owned string instead of leaking string

This commit is contained in:
cynecx 2021-03-26 18:30:59 +01:00
parent 4ecaad98e0
commit 5ff3299dd6
16 changed files with 27 additions and 27 deletions

View file

@ -509,7 +509,7 @@ impl ImportGroup {
PathSegmentKind::SelfKw => ImportGroup::ThisModule,
PathSegmentKind::SuperKw => ImportGroup::SuperModule,
PathSegmentKind::CrateKw => ImportGroup::ThisCrate,
PathSegmentKind::Name(name) => match name.text() {
PathSegmentKind::Name(name) => match name.text().as_str() {
"std" => ImportGroup::Std,
"core" => ImportGroup::Std,
_ => ImportGroup::ExternCrate,