Skip to content

Commit

Permalink
Fix and un-allow clippy::use_self lints (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
waywardmonkeys authored Dec 17, 2024
1 parent bef2115 commit 4154537
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 19 deletions.
28 changes: 14 additions & 14 deletions fontique/src/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,21 @@ impl GenericFamily {
}

/// Returns a slice containing all generic family variants.
pub const fn all() -> &'static [GenericFamily] {
pub const fn all() -> &'static [Self] {
&[
GenericFamily::SansSerif,
GenericFamily::Serif,
GenericFamily::Monospace,
GenericFamily::Cursive,
GenericFamily::Fantasy,
GenericFamily::SystemUi,
GenericFamily::UiSerif,
GenericFamily::UiSansSerif,
GenericFamily::UiMonospace,
GenericFamily::UiRounded,
GenericFamily::Emoji,
GenericFamily::Math,
GenericFamily::FangSong,
Self::SansSerif,
Self::Serif,
Self::Monospace,
Self::Cursive,
Self::Fantasy,
Self::SystemUi,
Self::UiSerif,
Self::UiSansSerif,
Self::UiMonospace,
Self::UiRounded,
Self::Emoji,
Self::Math,
Self::FangSong,
]
}
}
Expand Down
1 change: 0 additions & 1 deletion fontique/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#![allow(clippy::exhaustive_enums)]
#![allow(clippy::partial_pub_fields)]
#![allow(clippy::shadow_unrelated)]
#![allow(clippy::use_self)]

#[cfg(not(any(feature = "std", feature = "libm")))]
compile_error!("fontique requires either the `std` or `libm` feature to be enabled");
Expand Down
2 changes: 1 addition & 1 deletion fontique/src/script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub struct Script(pub [u8; 4]);

impl Script {
/// Returns a mapping of scripts to sample text.
pub fn all_samples() -> &'static [(Script, &'static str)] {
pub fn all_samples() -> &'static [(Self, &'static str)] {
SCRIPT_SAMPLES
}

Expand Down
2 changes: 1 addition & 1 deletion parley/src/layout/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ impl Selection {

/// Creates a new selection bounding the line at the given coordinates.
pub fn line_from_point<B: Brush>(layout: &Layout<B>, x: f32, y: f32) -> Self {
let Selection { anchor, focus, .. } = Self::from_point(layout, x, y)
let Self { anchor, focus, .. } = Self::from_point(layout, x, y)
.line_start(layout, false)
.line_end(layout, true);
Self {
Expand Down
1 change: 0 additions & 1 deletion parley/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@
#![allow(clippy::missing_assert_message)]
#![allow(clippy::missing_panics_doc)]
#![allow(clippy::shadow_unrelated)]
#![allow(clippy::use_self)]

#[cfg(not(any(feature = "std", feature = "libm")))]
compile_error!("parley requires either the `std` or `libm` feature to be enabled");
Expand Down
2 changes: 1 addition & 1 deletion parley/src/tests/utils/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ impl TestEnv {
collection
.family_id(DEFAULT_FONT_NAME)
.unwrap_or_else(|| panic!("{} font not found", DEFAULT_FONT_NAME));
TestEnv {
Self {
test_name: test_name.to_string(),
check_counter: 0,
font_cx: FontContext {
Expand Down

0 comments on commit 4154537

Please sign in to comment.