Apply some clippy suggestions

This commit is contained in:
Graham Esau 2021-03-19 23:20:16 +00:00
parent b8c548136a
commit 3a7d7ad905
7 changed files with 15 additions and 22 deletions

View file

@ -52,7 +52,7 @@ fn get_doc(attrs: &[Attribute]) -> Option<String> {
.iter()
.flat_map(|a| a.split('\n'))
.map(str::trim)
.skip_while(|s| *s == "")
.skip_while(|s| s.is_empty())
.collect::<Vec<_>>();
if let Some(&"") = lines.last() {
@ -61,7 +61,7 @@ fn get_doc(attrs: &[Attribute]) -> Option<String> {
// Added for backward-compatibility, but perhaps we shouldn't do this
// https://github.com/rust-lang/rust/issues/32088
if lines.iter().all(|l| l.starts_with("*")) {
if lines.iter().all(|l| l.starts_with('*')) {
for line in lines.iter_mut() {
*line = line[1..].trim()
}