Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update stable Rust, fix clippy lints #404

Merged
merged 1 commit into from
Dec 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ env:
# version like 1.70. Note that we only specify MAJOR.MINOR and not PATCH so that bugfixes still
# come automatically. If the version specified here is no longer the latest stable version,
# then please feel free to submit a PR that adjusts it along with the potential clippy fixes.
RUST_STABLE_VER: "1.82" # In quotes because otherwise (e.g.) 1.70 would be interpreted as 1.7
RUST_STABLE_VER: "1.83" # In quotes because otherwise (e.g.) 1.70 would be interpreted as 1.7
# The purpose of checking with the minimum supported Rust toolchain is to detect its staleness.
# If the compilation fails, then the version specified here needs to be bumped up to reality.
# Be sure to also update the rust-version property in the workspace Cargo.toml file,
Expand Down
2 changes: 2 additions & 0 deletions benches/rect_expand.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright 2020 the Kurbo Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

//! Benchmarks of rect expansion.

#![cfg(nightly)]
#![feature(test)]
extern crate test;
Expand Down
9 changes: 5 additions & 4 deletions src/bezpath.rs
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ impl Mul<BezPath> for Affine {
}
}

impl<'a> Mul<&'a BezPath> for Affine {
impl Mul<&BezPath> for Affine {
type Output = BezPath;

fn mul(self, other: &BezPath) -> BezPath {
Expand Down Expand Up @@ -713,7 +713,7 @@ impl Mul<BezPath> for TranslateScale {
}
}

impl<'a> Mul<&'a BezPath> for TranslateScale {
impl Mul<&BezPath> for TranslateScale {
type Output = BezPath;

fn mul(self, other: &BezPath) -> BezPath {
Expand Down Expand Up @@ -1358,8 +1358,9 @@ impl PathEl {
/// If the slice starts with `LineTo`, `QuadTo`, or `CurveTo`, it will be treated as a `MoveTo`.
impl<'a> Shape for &'a [PathEl] {
type PathElementsIter<'iter>

= core::iter::Copied<core::slice::Iter<'a, PathEl>> where 'a: 'iter;
= core::iter::Copied<core::slice::Iter<'a, PathEl>>
where
'a: 'iter;

#[inline]
fn path_elements(&self, _tolerance: f64) -> Self::PathElementsIter<'_> {
Expand Down
2 changes: 1 addition & 1 deletion src/quadspline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ struct ToQuadBez<'a> {
points: &'a Vec<Point>,
}

impl<'a> Iterator for ToQuadBez<'a> {
impl Iterator for ToQuadBez<'_> {
type Item = QuadBez;

fn next(&mut self) -> Option<Self::Item> {
Expand Down
6 changes: 4 additions & 2 deletions src/shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,10 @@ pub trait Shape {
/// Blanket implementation so `impl Shape` will accept owned or reference.
impl<'a, T: Shape> Shape for &'a T {
type PathElementsIter<'iter>

= T::PathElementsIter<'iter> where T: 'iter, 'a: 'iter;
= T::PathElementsIter<'iter>
where
T: 'iter,
'a: 'iter;

fn path_elements(&self, tolerance: f64) -> Self::PathElementsIter<'_> {
(*self).path_elements(tolerance)
Expand Down
2 changes: 1 addition & 1 deletion src/stroke.rs
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ enum DashState {
FromStash,
}

impl<'a, T: Iterator<Item = PathEl>> Iterator for DashIterator<'a, T> {
impl<T: Iterator<Item = PathEl>> Iterator for DashIterator<'_, T> {
type Item = PathEl;

fn next(&mut self) -> Option<PathEl> {
Expand Down
2 changes: 1 addition & 1 deletion src/svg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ struct SvgLexer<'a> {
pub last_pt: Point,
}

impl<'a> SvgLexer<'a> {
impl SvgLexer<'_> {
fn new(data: &str) -> SvgLexer {
SvgLexer {
data,
Expand Down