mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
toml_config_derive: fix clippy warning
This commit is contained in:
parent
aeeeda1b2b
commit
cbbfa9afef
1 changed files with 9 additions and 12 deletions
|
|
@ -146,21 +146,18 @@ fn extract_comment_string(attrs: Vec<Attribute>) -> TokenStream {
|
||||||
}
|
}
|
||||||
|
|
||||||
for token_tree in attr.tokens {
|
for token_tree in attr.tokens {
|
||||||
match token_tree {
|
if let TokenTree::Literal(literal) = token_tree {
|
||||||
TokenTree::Literal(literal) => {
|
let mut comment = format!("{}", literal);
|
||||||
let mut comment = format!("{}", literal);
|
|
||||||
|
|
||||||
// Strip leading and trailing quotation marks
|
// Strip leading and trailing quotation marks
|
||||||
comment.remove(comment.len() - 1);
|
comment.remove(comment.len() - 1);
|
||||||
comment.remove(0);
|
comment.remove(0);
|
||||||
|
|
||||||
// Add toml comment indicator
|
// Add toml comment indicator
|
||||||
comment.insert(0, '#');
|
comment.insert(0, '#');
|
||||||
|
|
||||||
output.push_str(&comment);
|
output.push_str(&comment);
|
||||||
output.push('\n');
|
output.push('\n');
|
||||||
}
|
|
||||||
_ => {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue