diff --git a/pagetop/src/core/module/all.rs b/pagetop/src/core/module/all.rs index e5bbcabb..9bd74c79 100644 --- a/pagetop/src/core/module/all.rs +++ b/pagetop/src/core/module/all.rs @@ -4,7 +4,7 @@ use crate::core::theme::all::THEMES; use crate::{service, trace, LazyStatic}; #[cfg(feature = "database")] -use crate::{db::*}; +use crate::db::*; use std::sync::RwLock; diff --git a/pagetop/src/html/assets/headscript.rs b/pagetop/src/html/assets/headscript.rs index 2cea8186..51c649ce 100644 --- a/pagetop/src/html/assets/headscript.rs +++ b/pagetop/src/html/assets/headscript.rs @@ -25,18 +25,15 @@ impl AssetsTrait for HeadScript { } impl HeadScript { - pub fn named(path: S) -> Self - where - S: Into, - { + pub fn named(path: impl Into) -> Self { HeadScript { path: path.into(), ..Default::default() } } - pub fn with_code(mut self, code: &str) -> Self { - self.code = code.trim().to_owned(); + pub fn with_code(mut self, code: impl Into) -> Self { + self.code = code.into().trim().to_owned(); self } diff --git a/pagetop/src/html/assets/headstyles.rs b/pagetop/src/html/assets/headstyles.rs index 9608d666..1a00430e 100644 --- a/pagetop/src/html/assets/headstyles.rs +++ b/pagetop/src/html/assets/headstyles.rs @@ -25,18 +25,15 @@ impl AssetsTrait for HeadStyles { } impl HeadStyles { - pub fn named(path: S) -> Self - where - S: Into, - { + pub fn named(path: impl Into) -> Self { HeadStyles { path: path.into(), ..Default::default() } } - pub fn with_styles(mut self, styles: &str) -> Self { - self.styles = styles.trim().to_owned(); + pub fn with_styles(mut self, styles: impl Into) -> Self { + self.styles = styles.into().trim().to_owned(); self } diff --git a/pagetop/src/html/assets/javascript.rs b/pagetop/src/html/assets/javascript.rs index e69a1ae1..526ab412 100644 --- a/pagetop/src/html/assets/javascript.rs +++ b/pagetop/src/html/assets/javascript.rs @@ -41,10 +41,7 @@ impl AssetsTrait for JavaScript { } impl JavaScript { - pub fn at(path: S) -> Self - where - S: Into, - { + pub fn at(path: impl Into) -> Self { JavaScript { path: path.into(), ..Default::default() diff --git a/pagetop/src/html/assets/stylesheet.rs b/pagetop/src/html/assets/stylesheet.rs index 2cc53a1e..b670f21e 100644 --- a/pagetop/src/html/assets/stylesheet.rs +++ b/pagetop/src/html/assets/stylesheet.rs @@ -39,10 +39,7 @@ impl AssetsTrait for StyleSheet { } impl StyleSheet { - pub fn at(path: S) -> Self - where - S: Into, - { + pub fn at(path: impl Into) -> Self { StyleSheet { path: path.into(), ..Default::default()