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 concise with
an identifier already being in scope and not needing qualifications.
  • Loading branch information
waywardmonkeys committed May 20, 2024
1 parent 2e16a97 commit 884483b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ version = "0.11.0"
authors = ["Raph Levien <[email protected]>"]
license = "MIT OR Apache-2.0"
edition = "2021"
# TODO: When this hits 1.74, move lint configuration into this file via a lints table.
rust-version = "1.65" # When updating this, also update the README.md and CI.
keywords = ["graphics", "curve", "curves", "bezier", "geometry"]
repository = "https://github.com/linebender/kurbo"
Expand Down
4 changes: 2 additions & 2 deletions src/bezpath.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ impl PathSeg {
let c1 = dy * px1 - dx * py1;
let c2 = dy * px2 - dx * py2;
let invlen2 = (dx * dx + dy * dy).recip();
for t in crate::common::solve_quadratic(c0, c1, c2) {
for t in solve_quadratic(c0, c1, c2) {
if (-EPSILON..=(1.0 + EPSILON)).contains(&t) {
let x = px0 + t * px1 + t * t * px2;
let y = py0 + t * py1 + t * t * py2;
Expand All @@ -1104,7 +1104,7 @@ impl PathSeg {
let c2 = dy * px2 - dx * py2;
let c3 = dy * px3 - dx * py3;
let invlen2 = (dx * dx + dy * dy).recip();
for t in crate::common::solve_cubic(c0, c1, c2, c3) {
for t in solve_cubic(c0, c1, c2, c3) {
if (-EPSILON..=(1.0 + EPSILON)).contains(&t) {
let x = px0 + t * px1 + t * t * px2 + t * t * t * px3;
let y = py0 + t * py1 + t * t * py2 + t * t * t * py3;
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
#![deny(missing_docs, clippy::trivially_copy_pass_by_ref)]
#![warn(clippy::doc_markdown, rustdoc::broken_intra_doc_links)]
#![warn(clippy::semicolon_if_nothing_returned)]
#![warn(unused_qualifications)]
#![allow(
clippy::unreadable_literal,
clippy::many_single_char_names,
Expand Down
4 changes: 2 additions & 2 deletions src/svg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ mod tests {

let length = rng.gen_range(0..MAX_LENGTH);
for _ in 0..length {
let should_follow: bool = rand::random();
let should_follow: bool = random();
let kind = rng.gen_range(0..3);

let first = position
Expand Down Expand Up @@ -647,7 +647,7 @@ mod tests {
#[test]
fn test_serialize_deserialize() {
const N_TESTS: u32 = 100;
let mut rng = rand::thread_rng();
let mut rng = thread_rng();

for _ in 0..N_TESTS {
let vec = gen_random_path_sequence(&mut rng);
Expand Down

0 comments on commit 884483b

Please sign in to comment.