Shorten trim call

This commit is contained in:
ivan770 2021-03-12 11:01:43 +02:00
parent 71a97a2d8c
commit 56ca843695
No known key found for this signature in database
GPG Key ID: D8C4BD5AE4D9CC4D

View File

@ -176,7 +176,7 @@ fn structure_token(token: SyntaxToken) -> Option<StructureNode> {
if let Some(comment) = ast::Comment::cast(token) {
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 {
parent: None,
label: region_name.to_string(),