summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Neumann <sven@svenfoo.org>2021-01-27 11:18:41 +0100
committerSven Neumann <sven@svenfoo.org>2021-01-27 11:20:34 +0100
commitf2654e24ae0ff4ed38f7f90d257dfdadcc6b94d4 (patch)
treed9d43b65519e40e4a01b25e513e7b405f54a95bc
parentbc801836087bc413d8f4728d6376034ac0c0e305 (diff)
downloadlibrsvg-fix-lifetime-warnings.tar.gz
Replace explicit lifetimes with anonymous ones where possiblefix-lifetime-warnings
Here the lifetime is only specified because it is needed by type declaration, so an anonymous lifetime can be used instead. https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
-rw-r--r--src/filters/component_transfer.rs2
-rw-r--r--src/parsers.rs2
-rw-r--r--src/path_builder.rs14
3 files changed, 9 insertions, 9 deletions
diff --git a/src/filters/component_transfer.rs b/src/filters/component_transfer.rs
index 280cc63b..2d073ea7 100644
--- a/src/filters/component_transfer.rs
+++ b/src/filters/component_transfer.rs
@@ -330,7 +330,7 @@ impl FilterEffect for FeComponentTransfer {
let func_a = func_or_default!(func_a_node, FeFuncA, func_a_element, func_a_default);
#[inline]
- fn compute_func<'a, F>(func: &'a F) -> impl Fn(u8, f64, f64) -> u8 + 'a
+ fn compute_func<F>(func: &F) -> impl Fn(u8, f64, f64) -> u8 + '_
where
F: FeComponentTransferFunc,
{
diff --git a/src/parsers.rs b/src/parsers.rs
index 6b138149..59c8dc6e 100644
--- a/src/parsers.rs
+++ b/src/parsers.rs
@@ -29,7 +29,7 @@ pub trait Parse: Sized {
}
/// Consumes a comma if it exists, or does nothing.
-pub fn optional_comma<'i, 't>(parser: &mut Parser<'i, 't>) {
+pub fn optional_comma(parser: &mut Parser<'_, '_>) {
let _ = parser.try_parse(|p| p.expect_comma());
}
diff --git a/src/path_builder.rs b/src/path_builder.rs
index 56eb8688..0c74bb3f 100644
--- a/src/path_builder.rs
+++ b/src/path_builder.rs
@@ -34,7 +34,7 @@ impl CubicBezierCurve {
cr.curve_to(pt1.0, pt1.1, pt2.0, pt2.1, to.0, to.1);
}
- fn from_coords<'a>(coords: &mut slice::Iter<'a, f64>) -> CubicBezierCurve {
+ fn from_coords(coords: &mut slice::Iter<'_, f64>) -> CubicBezierCurve {
let pt1 = take_two(coords);
let pt2 = take_two(coords);
let to = take_two(coords);
@@ -245,10 +245,10 @@ impl EllipticalArc {
}
}
- fn from_coords<'a>(
+ fn from_coords(
large_arc: LargeArc,
sweep: Sweep,
- coords: &mut slice::Iter<'a, f64>,
+ coords: &mut slice::Iter<'_, f64>,
) -> EllipticalArc {
let r = take_two(coords);
let x_axis_rotation = take_one(coords);
@@ -385,7 +385,7 @@ impl PathCommand {
}
}
- fn from_packed<'a>(packed: PackedCommand, coords: &mut slice::Iter<'a, f64>) -> PathCommand {
+ fn from_packed(packed: PackedCommand, coords: &mut slice::Iter<'_, f64>) -> PathCommand {
match packed {
PackedCommand::MoveTo => {
let x = take_one(coords);
@@ -623,7 +623,7 @@ impl Path {
}
}
- pub fn iter<'a>(&'a self) -> impl Iterator<Item = PathCommand> + 'a {
+ pub fn iter(&self) -> impl Iterator<Item = PathCommand> + '_ {
let commands = self.commands.iter();
let mut coords = self.coords.iter();
@@ -690,11 +690,11 @@ impl Path {
}
}
-fn take_one<'a>(iter: &mut slice::Iter<'a, f64>) -> f64 {
+fn take_one(iter: &mut slice::Iter<'_, f64>) -> f64 {
*iter.next().unwrap()
}
-fn take_two<'a>(iter: &mut slice::Iter<'a, f64>) -> (f64, f64) {
+fn take_two(iter: &mut slice::Iter<'_, f64>) -> (f64, f64) {
(take_one(iter), take_one(iter))
}