diff options
author | Christian Duerr <chrisduerr@users.noreply.github.com> | 2018-07-01 16:31:46 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-01 16:31:46 +0000 |
commit | 12afbd007db8a8995617b3e7ebda3840860bbadc (patch) | |
tree | a0de7c3db93b18b5edbbe44ab2f6b179ae6acc28 /font | |
parent | d5690f6cc75908d81d0eccf57e62d486c13d34f5 (diff) | |
download | alacritty-12afbd007db8a8995617b3e7ebda3840860bbadc.tar.gz alacritty-12afbd007db8a8995617b3e7ebda3840860bbadc.zip |
Fix clippy issues
Diffstat (limited to 'font')
-rw-r--r-- | font/src/darwin/mod.rs | 6 | ||||
-rw-r--r-- | font/src/ft/fc/mod.rs | 4 | ||||
-rw-r--r-- | font/src/ft/mod.rs | 6 | ||||
-rw-r--r-- | font/src/lib.rs | 2 |
4 files changed, 9 insertions, 9 deletions
diff --git a/font/src/darwin/mod.rs b/font/src/darwin/mod.rs index 843d75dd..4351af61 100644 --- a/font/src/darwin/mod.rs +++ b/font/src/darwin/mod.rs @@ -162,7 +162,7 @@ impl ::Rasterize for Rasterizer { } /// Get rasterized glyph for given glyph key - fn get_glyph(&mut self, glyph: &GlyphKey) -> Result<RasterizedGlyph, Error> { + fn get_glyph(&mut self, glyph: GlyphKey) -> Result<RasterizedGlyph, Error> { // get loaded font let font = self.fonts @@ -246,7 +246,7 @@ impl Rasterizer { // Helper to try and get a glyph for a given font. Used for font fallback. fn maybe_get_glyph( &self, - glyph: &GlyphKey, + glyph: GlyphKey, font: &Font, ) -> Option<Result<RasterizedGlyph, Error>> { let scaled_size = self.device_pixel_ratio * glyph.size.as_f32_pts(); @@ -356,7 +356,7 @@ impl Descriptor { let menlo = ct_new_from_descriptor(&descriptor.ct_descriptor, size); // TODO fixme, hardcoded en for english - let mut fallbacks = cascade_list_for_languages(&menlo, &vec!["en".to_owned()]) + let mut fallbacks = cascade_list_for_languages(&menlo, &["en".to_owned()]) .into_iter() .filter(|desc| desc.font_path != "") .map(|desc| desc.to_font(size, false)) diff --git a/font/src/ft/fc/mod.rs b/font/src/ft/fc/mod.rs index ac0c9442..865f63c9 100644 --- a/font/src/ft/fc/mod.rs +++ b/font/src/ft/fc/mod.rs @@ -180,9 +180,9 @@ pub enum Width { } impl Width { - fn to_isize(&self) -> isize { + fn to_isize(self) -> isize { use self::Width::*; - match *self { + match self { Ultracondensed => 50, Extracondensed => 63, Condensed => 75, diff --git a/font/src/ft/mod.rs b/font/src/ft/mod.rs index 7c5fb768..cdae88cb 100644 --- a/font/src/ft/mod.rs +++ b/font/src/ft/mod.rs @@ -102,7 +102,7 @@ impl ::Rasterize for FreeTypeRasterizer { self.get_face(desc, size) } - fn get_glyph(&mut self, glyph_key: &GlyphKey) -> Result<RasterizedGlyph, Error> { + fn get_glyph(&mut self, glyph_key: GlyphKey) -> Result<RasterizedGlyph, Error> { self.get_rendered_glyph(glyph_key) } @@ -264,7 +264,7 @@ impl FreeTypeRasterizer { } } - fn face_for_glyph(&mut self, glyph_key: &GlyphKey, have_recursed: bool) -> Result<FontKey, Error> { + fn face_for_glyph(&mut self, glyph_key: GlyphKey, have_recursed: bool) -> Result<FontKey, Error> { let c = glyph_key.c; let use_initial_face = if self.faces.contains_key(&glyph_key.font_key) { @@ -285,7 +285,7 @@ impl FreeTypeRasterizer { } } - fn get_rendered_glyph(&mut self, glyph_key: &GlyphKey) + fn get_rendered_glyph(&mut self, glyph_key: GlyphKey) -> Result<RasterizedGlyph, Error> { // Render a custom symbol for the underline and beam cursor match glyph_key.c { diff --git a/font/src/lib.rs b/font/src/lib.rs index 05680da2..ad94d084 100644 --- a/font/src/lib.rs +++ b/font/src/lib.rs @@ -344,5 +344,5 @@ pub trait Rasterize { fn load_font(&mut self, &FontDesc, Size) -> Result<FontKey, Self::Err>; /// Rasterize the glyph described by `GlyphKey`. - fn get_glyph(&mut self, &GlyphKey) -> Result<RasterizedGlyph, Self::Err>; + fn get_glyph(&mut self, GlyphKey) -> Result<RasterizedGlyph, Self::Err>; } |