🧑‍💻 Passes fmt and clippy checks

This commit is contained in:
Manuel Cillero 2023-07-25 21:57:45 +02:00
parent 5b9a53cbc6
commit d786ea1052
3 changed files with 4 additions and 10 deletions

View file

@ -101,10 +101,7 @@ impl PoweredBy {
#[fn_builder]
pub fn alter_copyright(&mut self, copyright: Option<impl Into<String>>) -> &mut Self {
self.copyright = match copyright {
Some(c) => Some(c.into()),
_ => None,
};
self.copyright = copyright.map(|c| c.into());
self
}

View file

@ -48,8 +48,7 @@ impl Minimal {
fn after_prepare_body(page: &mut Page) {
if let Some(true) = page.context().get_param::<bool>(PARAM_MINIMAL_ASSETS) {
page.context().alter(ContextOp::AddStyleSheet(
StyleSheet::at("/minimal/css/minimal.css")
.with_version(VERSION_MINIMAL)
StyleSheet::at("/minimal/css/minimal.css").with_version(VERSION_MINIMAL),
));
}
}

View file

@ -55,10 +55,8 @@ impl PackComponents {
pub(crate) fn merge(packs: &[Option<&PackComponents>]) -> Self {
let mut pack = PackComponents::default();
for p in packs {
if let Some(p) = p {
pack.0.append(&mut p.0.clone());
}
for p in packs.iter().flatten() {
pack.0.append(&mut p.0.clone());
}
pack
}