Shorten trim call
This commit is contained in:
@@ -176,7 +176,7 @@ fn structure_token(token: SyntaxToken) -> Option<StructureNode> {
|
|||||||
if let Some(comment) = ast::Comment::cast(token) {
|
if let Some(comment) = ast::Comment::cast(token) {
|
||||||
let text = comment.text().trim();
|
let text = comment.text().trim();
|
||||||
|
|
||||||
if let Some(region_name) = text.strip_prefix("// region:").map(|text| text.trim()) {
|
if let Some(region_name) = text.strip_prefix("// region:").map(str::trim) {
|
||||||
return Some(StructureNode {
|
return Some(StructureNode {
|
||||||
parent: None,
|
parent: None,
|
||||||
label: region_name.to_string(),
|
label: region_name.to_string(),
|
||||||
|
|||||||
Reference in New Issue
Block a user