Skip to content

Commit

Permalink
lints: Enable warn(unused_qualifications)
Browse files Browse the repository at this point in the history
This helps point out where the code can be more concistent with an
identifier already being in scope and not needing qualifications.
  • Loading branch information
waywardmonkeys committed May 20, 2024
1 parent 0b62375 commit 3fabe01
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ members = [
[workspace.package]
edition = "2021"
# Keep in sync with RUST_MIN_VER in .github/workflows/ci.yml and with the relevant README.md files.
# TODO: When this hits 1.74, move lint configuration into this file via a lints table.
rust-version = "1.70"
license = "Apache-2.0 OR MIT"
repository = "https://github.com/linebender/parley"
Expand Down
2 changes: 1 addition & 1 deletion fontique/src/font.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ impl FontInfo {
pub(crate) fn from_font_ref(font: &FontRef, source: SourceInfo, index: u32) -> Option<Self> {
let (stretch, style, weight) = read_attributes(font);
let (axes, attr_axes) = if let Ok(fvar_axes) = font.fvar().and_then(|fvar| fvar.axes()) {
let mut axes = smallvec::SmallVec::<[AxisInfo; 1]>::with_capacity(fvar_axes.len());
let mut axes = SmallVec::<[AxisInfo; 1]>::with_capacity(fvar_axes.len());
let mut attrs_axes = 0u8;
for fvar_axis in fvar_axes {
let axis = AxisInfo {
Expand Down
2 changes: 2 additions & 0 deletions fontique/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

//! Font enumeration and fallback.
#![warn(unused_qualifications)]

// TODO: Remove this dead code allowance and hide the offending code behind the std feature gate.
#![cfg_attr(not(feature = "std"), allow(dead_code))]
#![cfg_attr(all(not(feature = "std"), not(test)), no_std)]
Expand Down
2 changes: 1 addition & 1 deletion fontique/src/script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl fmt::Debug for Script {
}
}

impl core::fmt::Display for Script {
impl fmt::Display for Script {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", core::str::from_utf8(&self.0).unwrap_or_default())
}
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

//! Rich text layout.
#![warn(unused_qualifications)]

// TODO: Remove this dead code allowance and hide the offending code behind the std feature gate.
#![cfg_attr(not(feature = "std"), allow(dead_code))]
#![cfg_attr(all(not(feature = "std"), not(test)), no_std)]
Expand Down
4 changes: 2 additions & 2 deletions src/shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use super::style::{Brush, FontFeature, FontVariation};
use crate::util::nearly_eq;
#[cfg(feature = "std")]
use crate::Font;
use fontique::{self, Attributes, Query, QueryFont};
use fontique::{self, Query, QueryFont};
use swash::shape::*;
#[cfg(feature = "std")]
use swash::text::cluster::{CharCluster, CharInfo, Token};
Expand Down Expand Up @@ -164,7 +164,7 @@ struct FontSelector<'a, 'b, B: Brush> {
rcx: &'a ResolveContext,
styles: &'a [RangedStyle<B>],
style_index: u16,
attrs: Attributes,
attrs: fontique::Attributes,
variations: &'a [FontVariation],
features: &'a [FontFeature],
}
Expand Down

0 comments on commit 3fabe01

Please sign in to comment.