summaryrefslogtreecommitdiff
path: root/font/src/ft/mod.rs
diff options
context:
space:
mode:
authorCole Helbling <cole.e.helbling@outlook.com>2020-01-16 16:59:27 -0800
committerKirill Chibisov <contact@kchibisov.com>2020-01-17 03:59:27 +0300
commit091296828a351b22564a760a8b322b165c03fd2b (patch)
tree177eef6d9d365df46b155a4b60b562694a027b16 /font/src/ft/mod.rs
parent3203d2b3fa53cbab0cb3cda1ce53ba28c24482ee (diff)
downloadalacritty-091296828a351b22564a760a8b322b165c03fd2b.tar.gz
alacritty-091296828a351b22564a760a8b322b165c03fd2b.zip
Replace `.nth(0)` with `.next()`
Clippy[1] says that `.next()` is more readable than `.nth(0)`. [1]: https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero
Diffstat (limited to 'font/src/ft/mod.rs')
-rw-r--r--font/src/ft/mod.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/font/src/ft/mod.rs b/font/src/ft/mod.rs
index d92ab7c4..5c5c4a73 100644
--- a/font/src/ft/mod.rs
+++ b/font/src/ft/mod.rs
@@ -251,7 +251,7 @@ impl FreeTypeRasterizer {
}
fn face_from_pattern(&mut self, pattern: &fc::Pattern) -> Result<Option<FontKey>, Error> {
- if let (Some(path), Some(index)) = (pattern.file(0), pattern.index().nth(0)) {
+ if let (Some(path), Some(index)) = (pattern.file(0), pattern.index().next()) {
if let Some(key) = self.keys.get(&path) {
return Ok(Some(*key));
}
@@ -547,7 +547,7 @@ impl FreeTypeRasterizer {
let config = fc::Config::get_current();
match fc::font_match(config, &mut pattern) {
Some(pattern) => {
- if let (Some(path), Some(_)) = (pattern.file(0), pattern.index().nth(0)) {
+ if let (Some(path), Some(_)) = (pattern.file(0), pattern.index().next()) {
match self.keys.get(&path) {
// We've previously loaded this font, so don't
// load it again.