1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2024-11-18 13:55:23 -05:00

Enable clippy in font/copypasta crates

Enabled clippy in the sub-crates font and copypasta. All issues
that were discovered by this change have also been fixed.
This commit is contained in:
Matthias Krüger 2018-07-03 00:11:24 +02:00 committed by Christian Duerr
parent 985ba306c7
commit 21eb50aa50
3 changed files with 8 additions and 3 deletions

View file

@ -1,5 +1,7 @@
//! A cross-platform clipboard library //! A cross-platform clipboard library
#![cfg_attr(feature = "cargo-clippy", deny(clippy, if_not_else, enum_glob_use, wrong_pub_self_convention))]
// This has to be here due to macro_use // This has to be here due to macro_use
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
#[macro_use] extern crate objc; #[macro_use] extern crate objc;

View file

@ -232,15 +232,15 @@ impl FreeTypeRasterizer {
let ft_face = self.library.new_face(&path, index)?; let ft_face = self.library.new_face(&path, index)?;
// Get available pixel sizes if font isn't scalable. // Get available pixel sizes if font isn't scalable.
let non_scalable = if !pattern.scalable().next().unwrap_or(true) { let non_scalable = if pattern.scalable().next().unwrap_or(true) {
None
} else {
let mut pixelsize = pattern.pixelsize(); let mut pixelsize = pattern.pixelsize();
debug!("pixelsizes: {:?}", pixelsize); debug!("pixelsizes: {:?}", pixelsize);
Some(FixedSize { Some(FixedSize {
pixelsize: pixelsize.next().expect("has 1+ pixelsize"), pixelsize: pixelsize.next().expect("has 1+ pixelsize"),
}) })
} else {
None
}; };
let face = Face { let face = Face {

View file

@ -17,6 +17,9 @@
//! CoreText is used on Mac OS. //! CoreText is used on Mac OS.
//! FreeType is used on everything that's not Mac OS. //! FreeType is used on everything that's not Mac OS.
//! Eventually, ClearType support will be available for windows //! Eventually, ClearType support will be available for windows
#![cfg_attr(feature = "cargo-clippy", deny(clippy, if_not_else, enum_glob_use, wrong_pub_self_convention))]
#[cfg(not(target_os = "macos"))] #[cfg(not(target_os = "macos"))]
extern crate fontconfig; extern crate fontconfig;
#[cfg(not(target_os = "macos"))] #[cfg(not(target_os = "macos"))]