diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-12-30 11:37:11 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-12-30 12:00:12 +0100 |
| commit | f5dcb84e36a38182218c7f907b861b12d2bd2c1c (patch) | |
| tree | 1fce04fb53d2ad5b61f5f3151e43d80e2684e579 /src/library/text.rs | |
| parent | fef55025177ea4f248e61b68fab365bfbc0e47fb (diff) | |
Make clippy a bit happier
Diffstat (limited to 'src/library/text.rs')
| -rw-r--r-- | src/library/text.rs | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/library/text.rs b/src/library/text.rs index df71fec9..26e949fc 100644 --- a/src/library/text.rs +++ b/src/library/text.rs @@ -173,13 +173,6 @@ pub enum FontFamily { Named(NamedFamily), } -impl FontFamily { - /// Create a named font family variant, directly from a string. - pub fn named(string: &str) -> Self { - Self::Named(NamedFamily::new(string)) - } -} - impl Debug for FontFamily { fn fmt(&self, f: &mut Formatter) -> fmt::Result { match self { @@ -193,13 +186,13 @@ impl Debug for FontFamily { dynamic! { FontFamily: "font family", - Value::Str(string) => Self::named(&string), + Value::Str(string) => Self::Named(NamedFamily::new(&string)), } castable! { Vec<FontFamily>, Expected: "string, generic family or array thereof", - Value::Str(string) => vec![FontFamily::named(&string)], + Value::Str(string) => vec![FontFamily::Named(NamedFamily::new(&string))], Value::Array(values) => { values.into_iter().filter_map(|v| v.cast().ok()).collect() }, |
