strip leading dots from copyright statements

This commit is contained in:
Pietro Albini 2023-03-09 12:04:45 +01:00
parent 656c31c862
commit 6473ff150f
No known key found for this signature in database
GPG key ID: CD76B35F7734769E

View file

@ -42,6 +42,7 @@ pub(crate) struct License {
impl License {
fn simplify(&mut self) {
self.remove_copyright_prefixes();
self.remove_trailing_dots();
self.copyright.sort();
self.copyright.dedup();
}
@ -62,4 +63,12 @@ impl License {
*copyright = stripped.into();
}
}
fn remove_trailing_dots(&mut self) {
for copyright in &mut self.copyright {
if copyright.ends_with('.') {
*copyright = copyright.trim_end_matches('.').to_string();
}
}
}
}