[librsvg] Explicitly add hidden lifetime parameters
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] Explicitly add hidden lifetime parameters
- Date: Thu, 13 Sep 2018 09:22:09 +0000 (UTC)
commit f148b6e673616af99c7726640856068f7f6be3e7
Author: Linus Unnebäck <linus folkdatorn se>
Date: Sun Sep 9 00:04:05 2018 +0200
Explicitly add hidden lifetime parameters
rsvg_internals/src/aspect_ratio.rs | 2 +-
rsvg_internals/src/clip_path.rs | 4 +-
rsvg_internals/src/color.rs | 4 +-
rsvg_internals/src/coord_units.rs | 4 +-
rsvg_internals/src/drawing_ctx.rs | 16 +++----
rsvg_internals/src/error.rs | 4 +-
rsvg_internals/src/filters/blend.rs | 4 +-
rsvg_internals/src/filters/bounds.rs | 6 +--
rsvg_internals/src/filters/color_matrix.rs | 4 +-
rsvg_internals/src/filters/component_transfer.rs | 20 ++++----
rsvg_internals/src/filters/composite.rs | 6 +--
rsvg_internals/src/filters/context.rs | 18 ++++----
rsvg_internals/src/filters/convolve_matrix.rs | 4 +-
rsvg_internals/src/filters/displacement_map.rs | 4 +-
rsvg_internals/src/filters/error.rs | 2 +-
rsvg_internals/src/filters/flood.rs | 4 +-
rsvg_internals/src/filters/gaussian_blur.rs | 4 +-
rsvg_internals/src/filters/image.rs | 10 ++--
rsvg_internals/src/filters/light/light_source.rs | 2 +-
rsvg_internals/src/filters/light/lighting.rs | 4 +-
rsvg_internals/src/filters/merge.rs | 8 ++--
rsvg_internals/src/filters/mod.rs | 10 ++--
rsvg_internals/src/filters/morphology.rs | 4 +-
rsvg_internals/src/filters/node.rs | 2 +-
rsvg_internals/src/filters/offset.rs | 4 +-
rsvg_internals/src/filters/tile.rs | 4 +-
rsvg_internals/src/filters/turbulence.rs | 4 +-
rsvg_internals/src/font_props.rs | 10 ++--
rsvg_internals/src/gradient.rs | 16 +++----
rsvg_internals/src/image.rs | 6 +--
rsvg_internals/src/iri.rs | 2 +-
rsvg_internals/src/length.rs | 8 ++--
rsvg_internals/src/link.rs | 10 ++--
rsvg_internals/src/load.rs | 4 +-
rsvg_internals/src/marker.rs | 12 ++---
rsvg_internals/src/mask.rs | 4 +-
rsvg_internals/src/node.rs | 26 +++++------
rsvg_internals/src/paint_server.rs | 6 +--
rsvg_internals/src/parsers.rs | 14 +++---
rsvg_internals/src/path_parser.rs | 2 +-
rsvg_internals/src/pattern.rs | 10 ++--
rsvg_internals/src/property_bag.rs | 20 ++++----
rsvg_internals/src/property_macros.rs | 8 ++--
rsvg_internals/src/shapes.rs | 40 ++++++++--------
rsvg_internals/src/state.rs | 6 +--
rsvg_internals/src/stop.rs | 2 +-
rsvg_internals/src/structure.rs | 28 +++++------
rsvg_internals/src/surface_utils/shared_surface.rs | 2 +-
rsvg_internals/src/text.rs | 54 +++++++++++-----------
rsvg_internals/src/transform.rs | 26 +++++------
rsvg_internals/src/unitinterval.rs | 2 +-
rsvg_internals/src/viewbox.rs | 2 +-
rsvg_internals/src/viewport.rs | 4 +-
53 files changed, 243 insertions(+), 243 deletions(-)
---
diff --git a/rsvg_internals/src/aspect_ratio.rs b/rsvg_internals/src/aspect_ratio.rs
index f7655a04..f851986a 100644
--- a/rsvg_internals/src/aspect_ratio.rs
+++ b/rsvg_internals/src/aspect_ratio.rs
@@ -213,7 +213,7 @@ impl Parse for AspectRatio {
type Data = ();
type Err = AttributeError;
- fn parse(parser: &mut Parser, _: ()) -> Result<AspectRatio, AttributeError> {
+ fn parse(parser: &mut Parser<'_, '_>, _: ()) -> Result<AspectRatio, AttributeError> {
AspectRatio::parse_input(parser).map_err(|_| {
AttributeError::Parse(ParseError::new(
"expected \"[defer] <align> [meet | slice]\"",
diff --git a/rsvg_internals/src/clip_path.rs b/rsvg_internals/src/clip_path.rs
index add8a99a..3a8f2347 100644
--- a/rsvg_internals/src/clip_path.rs
+++ b/rsvg_internals/src/clip_path.rs
@@ -32,7 +32,7 @@ impl NodeClipPath {
&self,
node: &RsvgNode,
affine_before_clip: &cairo::Matrix,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
) -> Result<(), RenderingError> {
let cascaded = node.get_cascaded_values();
@@ -79,7 +79,7 @@ impl NodeClipPath {
}
impl NodeTrait for NodeClipPath {
- fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag) -> NodeResult {
+ fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag<'_>) -> NodeResult {
for (_key, attr, value) in pbag.iter() {
match attr {
Attribute::ClipPathUnits => self.units.set(parse("clipPathUnits", value, ())?),
diff --git a/rsvg_internals/src/color.rs b/rsvg_internals/src/color.rs
index fb41bb67..85c4fdfb 100644
--- a/rsvg_internals/src/color.rs
+++ b/rsvg_internals/src/color.rs
@@ -12,7 +12,7 @@ impl Parse for cssparser::Color {
type Data = ();
type Err = AttributeError;
- fn parse(parser: &mut Parser, _: Self::Data) -> Result<cssparser::Color, AttributeError> {
+ fn parse(parser: &mut Parser<'_, '_>, _: Self::Data) -> Result<cssparser::Color, AttributeError> {
cssparser::Color::parse(parser)
.map_err(|_| AttributeError::Parse(ParseError::new("invalid syntax for color")))
}
@@ -22,7 +22,7 @@ impl Parse for cssparser::RGBA {
type Data = ();
type Err = AttributeError;
- fn parse(parser: &mut Parser, _: Self::Data) -> Result<cssparser::RGBA, AttributeError> {
+ fn parse(parser: &mut Parser<'_, '_>, _: Self::Data) -> Result<cssparser::RGBA, AttributeError> {
match cssparser::Color::parse(parser) {
Ok(cssparser::Color::RGBA(rgba)) => Ok(rgba),
Ok(cssparser::Color::CurrentColor) => Err(AttributeError::Value(
diff --git a/rsvg_internals/src/coord_units.rs b/rsvg_internals/src/coord_units.rs
index 1317baab..0896b831 100644
--- a/rsvg_internals/src/coord_units.rs
+++ b/rsvg_internals/src/coord_units.rs
@@ -19,7 +19,7 @@ impl Parse for CoordUnits {
type Data = ();
type Err = AttributeError;
- fn parse(parser: &mut Parser, _: ()) -> Result<CoordUnits, AttributeError> {
+ fn parse(parser: &mut Parser<'_, '_>, _: ()) -> Result<CoordUnits, AttributeError> {
let loc = parser.current_source_location();
parser
@@ -71,7 +71,7 @@ macro_rules! coord_units {
type Err = $crate::error::AttributeError;
fn parse(
- parser: &mut ::cssparser::Parser,
+ parser: &mut ::cssparser::Parser<'_, '_>,
_: (),
) -> Result<Self, $crate::error::AttributeError> {
Ok($name($crate::coord_units::CoordUnits::parse(parser, ())?))
diff --git a/rsvg_internals/src/drawing_ctx.rs b/rsvg_internals/src/drawing_ctx.rs
index 3c45f488..a8d62f23 100644
--- a/rsvg_internals/src/drawing_ctx.rs
+++ b/rsvg_internals/src/drawing_ctx.rs
@@ -145,7 +145,7 @@ impl<'a> DrawingCtx<'a> {
dpi_y: f64,
defs: &mut Defs,
is_testing: bool,
- ) -> DrawingCtx {
+ ) -> DrawingCtx<'_> {
let mut affine = cr.get_matrix();
let rect = cairo::Rectangle {
x: 0.0,
@@ -339,7 +339,7 @@ impl<'a> DrawingCtx<'a> {
node: &RsvgNode,
values: &ComputedValues,
clipping: bool,
- draw_fn: &mut FnMut(&mut DrawingCtx) -> Result<(), RenderingError>,
+ draw_fn: &mut FnMut(&mut DrawingCtx<'_>) -> Result<(), RenderingError>,
) -> Result<(), RenderingError> {
if clipping {
draw_fn(self)
@@ -758,7 +758,7 @@ impl<'a> DrawingCtx<'a> {
pub fn draw_node_on_surface(
&mut self,
node: &RsvgNode,
- cascaded: &CascadedValues,
+ cascaded: &CascadedValues<'_>,
surface: &cairo::ImageSurface,
width: f64,
height: f64,
@@ -789,7 +789,7 @@ impl<'a> DrawingCtx<'a> {
pub fn draw_node_from_stack(
&mut self,
- cascaded: &CascadedValues,
+ cascaded: &CascadedValues<'_>,
node: &RsvgNode,
clipping: bool,
) -> Result<(), RenderingError> {
@@ -1051,7 +1051,7 @@ pub extern "C" fn rsvg_drawing_ctx_draw_node_from_stack(
raw_tree: *const RsvgTree,
) -> glib_sys::gboolean {
assert!(!raw_draw_ctx.is_null());
- let draw_ctx = unsafe { &mut *(raw_draw_ctx as *mut DrawingCtx) };
+ let draw_ctx = unsafe { &mut *(raw_draw_ctx as *mut DrawingCtx<'_>) };
assert!(!raw_tree.is_null());
let tree = unsafe { &*(raw_tree as *const Tree) };
@@ -1075,7 +1075,7 @@ pub extern "C" fn rsvg_drawing_ctx_add_node_and_ancestors_to_stack(
raw_node: *const RsvgNode,
) {
assert!(!raw_draw_ctx.is_null());
- let draw_ctx = unsafe { &mut *(raw_draw_ctx as *mut DrawingCtx) };
+ let draw_ctx = unsafe { &mut *(raw_draw_ctx as *mut DrawingCtx<'_>) };
assert!(!raw_node.is_null());
let node = unsafe { &*raw_node };
@@ -1089,7 +1089,7 @@ pub extern "C" fn rsvg_drawing_ctx_get_ink_rect(
ink_rect: *mut cairo_sys::cairo_rectangle_t,
) -> glib_sys::gboolean {
assert!(!raw_draw_ctx.is_null());
- let draw_ctx = unsafe { &mut *(raw_draw_ctx as *mut DrawingCtx) };
+ let draw_ctx = unsafe { &mut *(raw_draw_ctx as *mut DrawingCtx<'_>) };
assert!(!ink_rect.is_null());
@@ -1156,7 +1156,7 @@ pub extern "C" fn rsvg_drawing_ctx_new(
#[no_mangle]
pub extern "C" fn rsvg_drawing_ctx_free(raw_draw_ctx: *mut RsvgDrawingCtx) {
assert!(!raw_draw_ctx.is_null());
- let draw_ctx = unsafe { &mut *(raw_draw_ctx as *mut DrawingCtx) };
+ let draw_ctx = unsafe { &mut *(raw_draw_ctx as *mut DrawingCtx<'_>) };
unsafe {
Box::from_raw(draw_ctx);
diff --git a/rsvg_internals/src/error.rs b/rsvg_internals/src/error.rs
index 0fbae762..b04a7e3a 100644
--- a/rsvg_internals/src/error.rs
+++ b/rsvg_internals/src/error.rs
@@ -52,7 +52,7 @@ impl error::Error for NodeError {
}
impl fmt::Display for NodeError {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self.err {
AttributeError::Parse(ref n) => write!(
f,
@@ -78,7 +78,7 @@ impl From<ParseError> for AttributeError {
}
impl<'a> From<BasicParseError<'a>> for AttributeError {
- fn from(e: BasicParseError) -> AttributeError {
+ fn from(e: BasicParseError<'_>) -> AttributeError {
AttributeError::from(ParseError::from(e))
}
}
diff --git a/rsvg_internals/src/filters/blend.rs b/rsvg_internals/src/filters/blend.rs
index 40c0e523..cd237df2 100644
--- a/rsvg_internals/src/filters/blend.rs
+++ b/rsvg_internals/src/filters/blend.rs
@@ -49,7 +49,7 @@ impl NodeTrait for Blend {
&self,
node: &RsvgNode,
handle: *const RsvgHandle,
- pbag: &PropertyBag,
+ pbag: &PropertyBag<'_>,
) -> NodeResult {
self.base.set_atts(node, handle, pbag)?;
@@ -72,7 +72,7 @@ impl Filter for Blend {
&self,
_node: &RsvgNode,
ctx: &FilterContext,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
) -> Result<FilterResult, FilterError> {
let input = self.base.get_input(ctx, draw_ctx)?;
let input_2 = ctx.get_input(draw_ctx, self.in2.borrow().as_ref())?;
diff --git a/rsvg_internals/src/filters/bounds.rs b/rsvg_internals/src/filters/bounds.rs
index d858cab3..cb8e90a4 100644
--- a/rsvg_internals/src/filters/bounds.rs
+++ b/rsvg_internals/src/filters/bounds.rs
@@ -83,7 +83,7 @@ impl<'a> BoundsBuilder<'a> {
/// Returns the final pixel bounds.
#[inline]
- pub fn into_irect(self, draw_ctx: &mut DrawingCtx) -> IRect {
+ pub fn into_irect(self, draw_ctx: &mut DrawingCtx<'_>) -> IRect {
let mut bbox = self.apply_properties(draw_ctx);
let effects_region = self.ctx.effects_region();
@@ -96,12 +96,12 @@ impl<'a> BoundsBuilder<'a> {
///
/// Used by feImage.
#[inline]
- pub fn into_irect_without_clipping(self, draw_ctx: &mut DrawingCtx) -> IRect {
+ pub fn into_irect_without_clipping(self, draw_ctx: &mut DrawingCtx<'_>) -> IRect {
self.apply_properties(draw_ctx).rect.unwrap().into()
}
/// Applies the filter primitive properties.
- fn apply_properties(mut self, draw_ctx: &mut DrawingCtx) -> BoundingBox {
+ fn apply_properties(mut self, draw_ctx: &mut DrawingCtx<'_>) -> BoundingBox {
if self.bbox.rect.is_none() || self.standard_input_was_referenced {
// The default value is the filter effects region.
let effects_region = self.ctx.effects_region();
diff --git a/rsvg_internals/src/filters/color_matrix.rs b/rsvg_internals/src/filters/color_matrix.rs
index 71e7f105..8da52bac 100644
--- a/rsvg_internals/src/filters/color_matrix.rs
+++ b/rsvg_internals/src/filters/color_matrix.rs
@@ -52,7 +52,7 @@ impl NodeTrait for ColorMatrix {
&self,
node: &RsvgNode,
handle: *const RsvgHandle,
- pbag: &PropertyBag,
+ pbag: &PropertyBag<'_>,
) -> NodeResult {
self.base.set_atts(node, handle, pbag)?;
@@ -170,7 +170,7 @@ impl Filter for ColorMatrix {
&self,
_node: &RsvgNode,
ctx: &FilterContext,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
) -> Result<FilterResult, FilterError> {
let input = self.base.get_input(ctx, draw_ctx)?;
let bounds = self
diff --git a/rsvg_internals/src/filters/component_transfer.rs
b/rsvg_internals/src/filters/component_transfer.rs
index 93170463..899dadce 100644
--- a/rsvg_internals/src/filters/component_transfer.rs
+++ b/rsvg_internals/src/filters/component_transfer.rs
@@ -68,15 +68,15 @@ struct FunctionParameters<'a> {
}
/// The compute function type.
-type Function = fn(&FunctionParameters, f64) -> f64;
+type Function = fn(&FunctionParameters<'_>, f64) -> f64;
/// The identity component transfer function.
-fn identity(_: &FunctionParameters, value: f64) -> f64 {
+fn identity(_: &FunctionParameters<'_>, value: f64) -> f64 {
value
}
/// The table component transfer function.
-fn table(params: &FunctionParameters, value: f64) -> f64 {
+fn table(params: &FunctionParameters<'_>, value: f64) -> f64 {
let n = params.table_values.len() - 1;
let k = (value * (n as f64)).floor() as usize;
@@ -95,7 +95,7 @@ fn table(params: &FunctionParameters, value: f64) -> f64 {
}
/// The discrete component transfer function.
-fn discrete(params: &FunctionParameters, value: f64) -> f64 {
+fn discrete(params: &FunctionParameters<'_>, value: f64) -> f64 {
let n = params.table_values.len();
let k = (value * (n as f64)).floor() as usize;
@@ -103,12 +103,12 @@ fn discrete(params: &FunctionParameters, value: f64) -> f64 {
}
/// The linear component transfer function.
-fn linear(params: &FunctionParameters, value: f64) -> f64 {
+fn linear(params: &FunctionParameters<'_>, value: f64) -> f64 {
params.slope * value + params.intercept
}
/// The gamma component transfer function.
-fn gamma(params: &FunctionParameters, value: f64) -> f64 {
+fn gamma(params: &FunctionParameters<'_>, value: f64) -> f64 {
params.amplitude * value.powf(params.exponent) + params.offset
}
@@ -177,7 +177,7 @@ impl FuncX {
/// Returns the component transfer function parameters.
#[inline]
- fn function_parameters(&self) -> FunctionParameters {
+ fn function_parameters(&self) -> FunctionParameters<'_> {
FunctionParameters {
table_values: self.table_values.borrow(),
slope: self.slope.get(),
@@ -207,7 +207,7 @@ impl NodeTrait for ComponentTransfer {
&self,
node: &RsvgNode,
handle: *const RsvgHandle,
- pbag: &PropertyBag,
+ pbag: &PropertyBag<'_>,
) -> NodeResult {
self.base.set_atts(node, handle, pbag)
}
@@ -219,7 +219,7 @@ impl NodeTrait for FuncX {
&self,
_node: &RsvgNode,
_handle: *const RsvgHandle,
- pbag: &PropertyBag,
+ pbag: &PropertyBag<'_>,
) -> NodeResult {
for (_key, attr, value) in pbag.iter() {
match attr {
@@ -276,7 +276,7 @@ impl Filter for ComponentTransfer {
&self,
node: &RsvgNode,
ctx: &FilterContext,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
) -> Result<FilterResult, FilterError> {
let input = self.base.get_input(ctx, draw_ctx)?;
let bounds = self
diff --git a/rsvg_internals/src/filters/composite.rs b/rsvg_internals/src/filters/composite.rs
index 2205578a..09652baf 100644
--- a/rsvg_internals/src/filters/composite.rs
+++ b/rsvg_internals/src/filters/composite.rs
@@ -65,7 +65,7 @@ impl NodeTrait for Composite {
&self,
node: &RsvgNode,
handle: *const RsvgHandle,
- pbag: &PropertyBag,
+ pbag: &PropertyBag<'_>,
) -> NodeResult {
self.base.set_atts(node, handle, pbag)?;
@@ -149,7 +149,7 @@ impl Filter for Composite {
&self,
_node: &RsvgNode,
ctx: &FilterContext,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
) -> Result<FilterResult, FilterError> {
let input = self.base.get_input(ctx, draw_ctx)?;
let input_2 = ctx.get_input(draw_ctx, self.in2.borrow().as_ref())?;
@@ -239,7 +239,7 @@ impl Parse for Operator {
type Data = ();
type Err = AttributeError;
- fn parse(parser: &mut Parser, _data: Self::Data) -> Result<Self, Self::Err> {
+ fn parse(parser: &mut Parser<'_, '_>, _data: Self::Data) -> Result<Self, Self::Err> {
let loc = parser.current_source_location();
parser
diff --git a/rsvg_internals/src/filters/context.rs b/rsvg_internals/src/filters/context.rs
index 90a2bb4e..e5023219 100644
--- a/rsvg_internals/src/filters/context.rs
+++ b/rsvg_internals/src/filters/context.rs
@@ -103,7 +103,7 @@ pub struct FilterContext {
fn compute_effects_region(
filter_node: &RsvgNode,
target_node: &RsvgNode,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
affine: cairo::Matrix,
width: f64,
height: f64,
@@ -195,7 +195,7 @@ impl FilterContext {
filter_node: &RsvgNode,
node_being_filtered: &RsvgNode,
source_surface: SharedImageSurface,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
) -> Self {
let cr_affine = draw_ctx.get_cairo_context().get_matrix();
let bbox = draw_ctx.get_bbox().clone();
@@ -300,7 +300,7 @@ impl FilterContext {
/// Computes and returns the background image snapshot.
fn compute_background_image(
&self,
- draw_ctx: &DrawingCtx,
+ draw_ctx: &DrawingCtx<'_>,
) -> Result<cairo::ImageSurface, cairo::Status> {
let surface = cairo::ImageSurface::create(
cairo::Format::ARgb32,
@@ -331,7 +331,7 @@ impl FilterContext {
/// Returns the surface corresponding to the background image snapshot.
pub fn background_image(
&self,
- draw_ctx: &DrawingCtx,
+ draw_ctx: &DrawingCtx<'_>,
) -> Result<&SharedImageSurface, FilterError> {
{
// At this point either no, or only immutable references to background_surface exist, so
@@ -366,7 +366,7 @@ impl FilterContext {
#[inline]
pub fn background_alpha(
&self,
- draw_ctx: &DrawingCtx,
+ draw_ctx: &DrawingCtx<'_>,
bounds: IRect,
) -> Result<SharedImageSurface, FilterError> {
self.background_image(draw_ctx)?
@@ -428,7 +428,7 @@ impl FilterContext {
}
/// Calls the given function with correct behavior for the value of `primitiveUnits`.
- pub fn with_primitive_units<F, T>(&self, draw_ctx: &mut DrawingCtx, f: F) -> T
+ pub fn with_primitive_units<F, T>(&self, draw_ctx: &mut DrawingCtx<'_>, f: F) -> T
// TODO: Get rid of this Box? Can't just impl Trait because Rust cannot do higher-ranked types.
where
for<'b> F: FnOnce(Box<Fn(&Length) -> f64 + 'b>) -> T,
@@ -455,7 +455,7 @@ impl FilterContext {
/// Computes and returns a surface corresponding to the given paint server.
fn get_paint_server_surface(
&self,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
paint_server: &PaintServer,
opacity: UnitInterval,
) -> Result<cairo::ImageSurface, cairo::Status> {
@@ -497,7 +497,7 @@ impl FilterContext {
/// Does not take `processing_linear_rgb` into account.
fn get_input_raw(
&self,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
in_: Option<&Input>,
) -> Result<FilterInput, FilterError> {
if in_.is_none() {
@@ -553,7 +553,7 @@ impl FilterContext {
/// Retrieves the filter input surface according to the SVG rules.
pub fn get_input(
&self,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
in_: Option<&Input>,
) -> Result<FilterInput, FilterError> {
let raw = self.get_input_raw(draw_ctx, in_)?;
diff --git a/rsvg_internals/src/filters/convolve_matrix.rs b/rsvg_internals/src/filters/convolve_matrix.rs
index 991c14a9..5b5cc66c 100644
--- a/rsvg_internals/src/filters/convolve_matrix.rs
+++ b/rsvg_internals/src/filters/convolve_matrix.rs
@@ -60,7 +60,7 @@ impl NodeTrait for ConvolveMatrix {
&self,
node: &RsvgNode,
handle: *const RsvgHandle,
- pbag: &PropertyBag,
+ pbag: &PropertyBag<'_>,
) -> NodeResult {
self.base.set_atts(node, handle, pbag)?;
@@ -216,7 +216,7 @@ impl Filter for ConvolveMatrix {
&self,
_node: &RsvgNode,
ctx: &FilterContext,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
) -> Result<FilterResult, FilterError> {
let input = self.base.get_input(ctx, draw_ctx)?;
let mut bounds = self
diff --git a/rsvg_internals/src/filters/displacement_map.rs b/rsvg_internals/src/filters/displacement_map.rs
index 8a9c7e05..91e2457a 100644
--- a/rsvg_internals/src/filters/displacement_map.rs
+++ b/rsvg_internals/src/filters/displacement_map.rs
@@ -51,7 +51,7 @@ impl NodeTrait for DisplacementMap {
&self,
node: &RsvgNode,
handle: *const RsvgHandle,
- pbag: &PropertyBag,
+ pbag: &PropertyBag<'_>,
) -> NodeResult {
self.base.set_atts(node, handle, pbag)?;
@@ -82,7 +82,7 @@ impl Filter for DisplacementMap {
&self,
_node: &RsvgNode,
ctx: &FilterContext,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
) -> Result<FilterResult, FilterError> {
let input = self.base.get_input(ctx, draw_ctx)?;
let displacement_input = ctx.get_input(draw_ctx, self.in2.borrow().as_ref())?;
diff --git a/rsvg_internals/src/filters/error.rs b/rsvg_internals/src/filters/error.rs
index 2d27294f..1b5f61ca 100644
--- a/rsvg_internals/src/filters/error.rs
+++ b/rsvg_internals/src/filters/error.rs
@@ -42,7 +42,7 @@ impl Error for FilterError {
}
impl fmt::Display for FilterError {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match *self {
FilterError::BadInputSurfaceStatus(ref status)
| FilterError::CairoError(ref status) => {
diff --git a/rsvg_internals/src/filters/flood.rs b/rsvg_internals/src/filters/flood.rs
index b938ba6a..ee87fcbb 100644
--- a/rsvg_internals/src/filters/flood.rs
+++ b/rsvg_internals/src/filters/flood.rs
@@ -31,7 +31,7 @@ impl NodeTrait for Flood {
&self,
node: &RsvgNode,
handle: *const RsvgHandle,
- pbag: &PropertyBag,
+ pbag: &PropertyBag<'_>,
) -> NodeResult {
self.base.set_atts(node, handle, pbag)
}
@@ -42,7 +42,7 @@ impl Filter for Flood {
&self,
node: &RsvgNode,
ctx: &FilterContext,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
) -> Result<FilterResult, FilterError> {
let bounds = self.base.get_bounds(ctx).into_irect(draw_ctx);
diff --git a/rsvg_internals/src/filters/gaussian_blur.rs b/rsvg_internals/src/filters/gaussian_blur.rs
index 45f1c5c3..448c2553 100644
--- a/rsvg_internals/src/filters/gaussian_blur.rs
+++ b/rsvg_internals/src/filters/gaussian_blur.rs
@@ -47,7 +47,7 @@ impl NodeTrait for GaussianBlur {
&self,
node: &RsvgNode,
handle: *const RsvgHandle,
- pbag: &PropertyBag,
+ pbag: &PropertyBag<'_>,
) -> NodeResult {
self.base.set_atts(node, handle, pbag)?;
@@ -206,7 +206,7 @@ impl Filter for GaussianBlur {
&self,
_node: &RsvgNode,
ctx: &FilterContext,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
) -> Result<FilterResult, FilterError> {
let input = self.base.get_input(ctx, draw_ctx)?;
let bounds = self
diff --git a/rsvg_internals/src/filters/image.rs b/rsvg_internals/src/filters/image.rs
index 2dc0360f..47177e04 100644
--- a/rsvg_internals/src/filters/image.rs
+++ b/rsvg_internals/src/filters/image.rs
@@ -50,7 +50,7 @@ impl Image {
fn render_node(
&self,
ctx: &FilterContext,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
bounds: IRect,
href: &str,
) -> Result<ImageSurface, FilterError> {
@@ -117,8 +117,8 @@ impl Image {
fn render_external_image(
&self,
ctx: &FilterContext,
- draw_ctx: &mut DrawingCtx,
- bounds_builder: BoundsBuilder,
+ draw_ctx: &mut DrawingCtx<'_>,
+ bounds_builder: BoundsBuilder<'_>,
href: &str,
) -> Result<ImageSurface, FilterError> {
let surface = {
@@ -201,7 +201,7 @@ impl NodeTrait for Image {
&self,
node: &RsvgNode,
handle: *const RsvgHandle,
- pbag: &PropertyBag,
+ pbag: &PropertyBag<'_>,
) -> NodeResult {
self.base.set_atts(node, handle, pbag)?;
@@ -230,7 +230,7 @@ impl Filter for Image {
&self,
_node: &RsvgNode,
ctx: &FilterContext,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
) -> Result<FilterResult, FilterError> {
let href = self.href.borrow();
let href = href.as_ref().ok_or(FilterError::InvalidInput)?;
diff --git a/rsvg_internals/src/filters/light/light_source.rs
b/rsvg_internals/src/filters/light/light_source.rs
index 9afdf41f..f6baf80a 100644
--- a/rsvg_internals/src/filters/light/light_source.rs
+++ b/rsvg_internals/src/filters/light/light_source.rs
@@ -205,7 +205,7 @@ impl NodeTrait for LightSource {
&self,
_node: &RsvgNode,
_handle: *const RsvgHandle,
- pbag: &PropertyBag,
+ pbag: &PropertyBag<'_>,
) -> NodeResult {
for (_key, attr, value) in pbag.iter() {
match self {
diff --git a/rsvg_internals/src/filters/light/lighting.rs b/rsvg_internals/src/filters/light/lighting.rs
index c06d8a90..2afbec73 100644
--- a/rsvg_internals/src/filters/light/lighting.rs
+++ b/rsvg_internals/src/filters/light/lighting.rs
@@ -102,7 +102,7 @@ impl NodeTrait for Lighting {
&self,
node: &RsvgNode,
handle: *const RsvgHandle,
- pbag: &PropertyBag,
+ pbag: &PropertyBag<'_>,
) -> NodeResult {
self.base.set_atts(node, handle, pbag)?;
@@ -202,7 +202,7 @@ impl Filter for Lighting {
&self,
node: &RsvgNode,
ctx: &FilterContext,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
) -> Result<FilterResult, FilterError> {
let input = self.base.get_input(ctx, draw_ctx)?;
let mut bounds = self
diff --git a/rsvg_internals/src/filters/merge.rs b/rsvg_internals/src/filters/merge.rs
index 3ecfa23f..a2799d33 100644
--- a/rsvg_internals/src/filters/merge.rs
+++ b/rsvg_internals/src/filters/merge.rs
@@ -49,7 +49,7 @@ impl NodeTrait for Merge {
&self,
node: &RsvgNode,
handle: *const RsvgHandle,
- pbag: &PropertyBag,
+ pbag: &PropertyBag<'_>,
) -> NodeResult {
self.base.set_atts(node, handle, pbag)
}
@@ -61,7 +61,7 @@ impl NodeTrait for MergeNode {
&self,
_node: &RsvgNode,
_handle: *const RsvgHandle,
- pbag: &PropertyBag,
+ pbag: &PropertyBag<'_>,
) -> NodeResult {
for (_key, attr, value) in pbag.iter() {
match attr {
@@ -80,7 +80,7 @@ impl MergeNode {
fn render(
&self,
ctx: &FilterContext,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
bounds: IRect,
output_surface: Option<SharedImageSurface>,
) -> Result<SharedImageSurface, FilterError> {
@@ -134,7 +134,7 @@ impl Filter for Merge {
&self,
node: &RsvgNode,
ctx: &FilterContext,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
) -> Result<FilterResult, FilterError> {
// Compute the filter bounds, taking each child node's input into account.
let mut bounds = self.base.get_bounds(ctx);
diff --git a/rsvg_internals/src/filters/mod.rs b/rsvg_internals/src/filters/mod.rs
index 3797b4c3..4dfba93b 100644
--- a/rsvg_internals/src/filters/mod.rs
+++ b/rsvg_internals/src/filters/mod.rs
@@ -58,7 +58,7 @@ trait Filter: NodeTrait {
&self,
node: &RsvgNode,
ctx: &FilterContext,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
) -> Result<FilterResult, FilterError>;
/// Returns `true` if this filter primitive is affected by the `color-interpolation-filters`
@@ -111,7 +111,7 @@ impl Primitive {
}
impl NodeTrait for Primitive {
- fn set_atts(&self, node: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag) -> NodeResult {
+ fn set_atts(&self, node: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag<'_>) -> NodeResult {
// With ObjectBoundingBox, only fractions and percents are allowed.
let primitiveunits = node
.get_parent()
@@ -189,7 +189,7 @@ impl PrimitiveWithInput {
fn get_input(
&self,
ctx: &FilterContext,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
) -> Result<FilterInput, FilterError> {
ctx.get_input(draw_ctx, self.in_.borrow().as_ref())
}
@@ -200,7 +200,7 @@ impl NodeTrait for PrimitiveWithInput {
&self,
node: &RsvgNode,
handle: *const RsvgHandle,
- pbag: &PropertyBag,
+ pbag: &PropertyBag<'_>,
) -> NodeResult {
self.base.set_atts(node, handle, pbag)?;
@@ -229,7 +229,7 @@ pub fn render(
filter_node: &RsvgNode,
node_being_filtered: &RsvgNode,
source: &cairo::ImageSurface,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
) -> cairo::ImageSurface {
let filter_node = &*filter_node;
assert_eq!(filter_node.get_type(), NodeType::Filter);
diff --git a/rsvg_internals/src/filters/morphology.rs b/rsvg_internals/src/filters/morphology.rs
index 307ee3a7..892a7ad3 100644
--- a/rsvg_internals/src/filters/morphology.rs
+++ b/rsvg_internals/src/filters/morphology.rs
@@ -52,7 +52,7 @@ impl NodeTrait for Morphology {
&self,
node: &RsvgNode,
handle: *const RsvgHandle,
- pbag: &PropertyBag,
+ pbag: &PropertyBag<'_>,
) -> NodeResult {
self.base.set_atts(node, handle, pbag)?;
@@ -83,7 +83,7 @@ impl Filter for Morphology {
&self,
_node: &RsvgNode,
ctx: &FilterContext,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
) -> Result<FilterResult, FilterError> {
let input = self.base.get_input(ctx, draw_ctx)?;
let bounds = self
diff --git a/rsvg_internals/src/filters/node.rs b/rsvg_internals/src/filters/node.rs
index c178da10..bf6483c0 100644
--- a/rsvg_internals/src/filters/node.rs
+++ b/rsvg_internals/src/filters/node.rs
@@ -40,7 +40,7 @@ impl NodeTrait for NodeFilter {
&self,
_node: &RsvgNode,
_handle: *const RsvgHandle,
- pbag: &PropertyBag,
+ pbag: &PropertyBag<'_>,
) -> NodeResult {
// Parse filterUnits first as it affects x, y, width, height checks.
for (_key, attr, value) in pbag.iter() {
diff --git a/rsvg_internals/src/filters/offset.rs b/rsvg_internals/src/filters/offset.rs
index 619998c2..66caff87 100644
--- a/rsvg_internals/src/filters/offset.rs
+++ b/rsvg_internals/src/filters/offset.rs
@@ -39,7 +39,7 @@ impl NodeTrait for Offset {
&self,
node: &RsvgNode,
handle: *const RsvgHandle,
- pbag: &PropertyBag,
+ pbag: &PropertyBag<'_>,
) -> NodeResult {
self.base.set_atts(node, handle, pbag)?;
@@ -64,7 +64,7 @@ impl Filter for Offset {
&self,
_node: &RsvgNode,
ctx: &FilterContext,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
) -> Result<FilterResult, FilterError> {
let input = self.base.get_input(ctx, draw_ctx)?;
let bounds = self
diff --git a/rsvg_internals/src/filters/tile.rs b/rsvg_internals/src/filters/tile.rs
index 44a27573..8cc2307e 100644
--- a/rsvg_internals/src/filters/tile.rs
+++ b/rsvg_internals/src/filters/tile.rs
@@ -29,7 +29,7 @@ impl NodeTrait for Tile {
&self,
node: &RsvgNode,
handle: *const RsvgHandle,
- pbag: &PropertyBag,
+ pbag: &PropertyBag<'_>,
) -> NodeResult {
self.base.set_atts(node, handle, pbag)
}
@@ -40,7 +40,7 @@ impl Filter for Tile {
&self,
_node: &RsvgNode,
ctx: &FilterContext,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
) -> Result<FilterResult, FilterError> {
let input = self.base.get_input(ctx, draw_ctx)?;
diff --git a/rsvg_internals/src/filters/turbulence.rs b/rsvg_internals/src/filters/turbulence.rs
index aa87cb79..74883639 100644
--- a/rsvg_internals/src/filters/turbulence.rs
+++ b/rsvg_internals/src/filters/turbulence.rs
@@ -65,7 +65,7 @@ impl NodeTrait for Turbulence {
&self,
node: &RsvgNode,
handle: *const RsvgHandle,
- pbag: &PropertyBag,
+ pbag: &PropertyBag<'_>,
) -> NodeResult {
self.base.set_atts(node, handle, pbag)?;
@@ -344,7 +344,7 @@ impl Filter for Turbulence {
&self,
node: &RsvgNode,
ctx: &FilterContext,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
) -> Result<FilterResult, FilterError> {
let bounds = self.base.get_bounds(ctx).into_irect(draw_ctx);
diff --git a/rsvg_internals/src/font_props.rs b/rsvg_internals/src/font_props.rs
index 9321f30b..302c37ec 100644
--- a/rsvg_internals/src/font_props.rs
+++ b/rsvg_internals/src/font_props.rs
@@ -76,7 +76,7 @@ impl Parse for FontSizeSpec {
type Data = ();
type Err = AttributeError;
- fn parse(parser: &mut Parser, _: Self::Data) -> Result<FontSizeSpec, ::error::AttributeError> {
+ fn parse(parser: &mut Parser<'_, '_>, _: Self::Data) -> Result<FontSizeSpec, ::error::AttributeError> {
let parser_state = parser.state();
Length::parse(parser, LengthDir::Both)
@@ -135,7 +135,7 @@ impl Parse for FontWeightSpec {
type Err = AttributeError;
fn parse(
- parser: &mut Parser,
+ parser: &mut Parser<'_, '_>,
_: Self::Data,
) -> Result<FontWeightSpec, ::error::AttributeError> {
if let Ok(r) = parser.try(|p| {
@@ -212,7 +212,7 @@ impl Parse for LetterSpacingSpec {
type Err = AttributeError;
fn parse(
- parser: &mut Parser,
+ parser: &mut Parser<'_, '_>,
_: Self::Data,
) -> Result<LetterSpacingSpec, ::error::AttributeError> {
let parser_state = parser.state();
@@ -250,14 +250,14 @@ impl Parse for SingleFontFamily {
type Data = ();
type Err = AttributeError;
- fn parse(parser: &mut Parser, _: Self::Data) -> Result<SingleFontFamily, AttributeError> {
+ fn parse(parser: &mut Parser<'_, '_>, _: Self::Data) -> Result<SingleFontFamily, AttributeError> {
parse_single_font_family(parser)
.map_err(|_| AttributeError::from(ParseError::new("expected font family")))
}
}
fn parse_single_font_family<'i>(
- parser: &'i mut Parser,
+ parser: &'i mut Parser<'_, '_>,
) -> Result<SingleFontFamily, BasicParseError<'i>> {
if let Ok(cow) = parser.try(|p| p.expect_string_cloned()) {
return Ok(SingleFontFamily((*cow).to_owned()));
diff --git a/rsvg_internals/src/gradient.rs b/rsvg_internals/src/gradient.rs
index 453f65bf..fea92125 100644
--- a/rsvg_internals/src/gradient.rs
+++ b/rsvg_internals/src/gradient.rs
@@ -39,7 +39,7 @@ impl Parse for SpreadMethod {
type Data = ();
type Err = AttributeError;
- fn parse(parser: &mut Parser, _: ()) -> Result<SpreadMethod, AttributeError> {
+ fn parse(parser: &mut Parser<'_, '_>, _: ()) -> Result<SpreadMethod, AttributeError> {
let loc = parser.current_source_location();
parser
@@ -415,7 +415,7 @@ impl Gradient {
}
}
-fn acquire_gradient<'a>(draw_ctx: &'a mut DrawingCtx, name: &str) -> Option<AcquiredNode> {
+fn acquire_gradient<'a>(draw_ctx: &'a mut DrawingCtx<'_>, name: &str) -> Option<AcquiredNode> {
draw_ctx.get_acquired_node(name).and_then(|acquired| {
// FIXME: replace with .filter() once Option.filter() becomes stable
let node = acquired.get();
@@ -429,7 +429,7 @@ fn acquire_gradient<'a>(draw_ctx: &'a mut DrawingCtx, name: &str) -> Option<Acqu
})
}
-fn resolve_gradient(gradient: &Gradient, draw_ctx: &mut DrawingCtx) -> Gradient {
+fn resolve_gradient(gradient: &Gradient, draw_ctx: &mut DrawingCtx<'_>) -> Gradient {
let mut result = gradient.clone();
while !result.is_resolved() {
@@ -457,7 +457,7 @@ fn resolve_gradient(gradient: &Gradient, draw_ctx: &mut DrawingCtx) -> Gradient
fn set_common_on_pattern<P: cairo::Pattern + cairo::Gradient>(
gradient: &Gradient,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
pattern: &mut P,
bbox: &BoundingBox,
opacity: &UnitInterval,
@@ -534,7 +534,7 @@ fn fix_focus_point(fx: f64, fy: f64, cx: f64, cy: f64, radius: f64) -> (f64, f64
fn set_pattern_on_draw_context(
gradient: &Gradient,
values: &ComputedValues,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
opacity: &UnitInterval,
bbox: &BoundingBox,
) {
@@ -605,7 +605,7 @@ impl NodeGradient {
}
impl NodeTrait for NodeGradient {
- fn set_atts(&self, node: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag) -> NodeResult {
+ fn set_atts(&self, node: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag<'_>) -> NodeResult {
let mut g = self.gradient.borrow_mut();
let mut x1 = None;
@@ -671,7 +671,7 @@ impl NodeTrait for NodeGradient {
pub fn gradient_resolve_fallbacks_and_set_pattern(
node: &RsvgNode,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
opacity: &UnitInterval,
bbox: &BoundingBox,
) -> bool {
@@ -689,7 +689,7 @@ pub fn gradient_resolve_fallbacks_and_set_pattern(
let cascaded = node.get_cascaded_values();
let values = cascaded.get();
- set_pattern_on_draw_context(&resolved, values, draw_ctx, opacity, bbox)
+ set_pattern_on_draw_context(&resolved, values, draw_ctx, opacity, bbox);
}
}
diff --git a/rsvg_internals/src/image.rs b/rsvg_internals/src/image.rs
index ea32205e..8e6a511c 100644
--- a/rsvg_internals/src/image.rs
+++ b/rsvg_internals/src/image.rs
@@ -46,7 +46,7 @@ impl NodeTrait for NodeImage {
&self,
node: &RsvgNode,
handle: *const RsvgHandle,
- pbag: &PropertyBag,
+ pbag: &PropertyBag<'_>,
) -> NodeResult {
// SVG element has overflow:hidden
// https://www.w3.org/TR/SVG/styling.html#UAStyleSheet
@@ -108,8 +108,8 @@ impl NodeTrait for NodeImage {
fn draw(
&self,
node: &RsvgNode,
- cascaded: &CascadedValues,
- draw_ctx: &mut DrawingCtx,
+ cascaded: &CascadedValues<'_>,
+ draw_ctx: &mut DrawingCtx<'_>,
clipping: bool,
) -> Result<(), RenderingError> {
let values = cascaded.get();
diff --git a/rsvg_internals/src/iri.rs b/rsvg_internals/src/iri.rs
index 113572e9..71ebbf4a 100644
--- a/rsvg_internals/src/iri.rs
+++ b/rsvg_internals/src/iri.rs
@@ -29,7 +29,7 @@ impl Parse for IRI {
type Data = ();
type Err = ParseError;
- fn parse(parser: &mut Parser, _: Self::Data) -> Result<IRI, ParseError> {
+ fn parse(parser: &mut Parser<'_, '_>, _: Self::Data) -> Result<IRI, ParseError> {
if parser.try(|i| i.expect_ident_matching("none")).is_ok() {
Ok(IRI::None)
} else {
diff --git a/rsvg_internals/src/length.rs b/rsvg_internals/src/length.rs
index 14b1c6da..25807b9f 100644
--- a/rsvg_internals/src/length.rs
+++ b/rsvg_internals/src/length.rs
@@ -66,7 +66,7 @@ impl Parse for Length {
type Data = LengthDir;
type Err = AttributeError;
- fn parse(parser: &mut Parser, dir: LengthDir) -> Result<Length, AttributeError> {
+ fn parse(parser: &mut Parser<'_, '_>, dir: LengthDir) -> Result<Length, AttributeError> {
let length = Length::from_cssparser(parser, dir)?;
parser.expect_exhausted().map_err(|_| make_err())?;
@@ -137,7 +137,7 @@ impl Length {
}
}
- pub fn from_cssparser(parser: &mut Parser, dir: LengthDir) -> Result<Length, AttributeError> {
+ pub fn from_cssparser(parser: &mut Parser<'_, '_>, dir: LengthDir) -> Result<Length, AttributeError> {
let length = {
let token = parser.next().map_err(|_| {
AttributeError::Parse(ParseError::new(
@@ -270,7 +270,7 @@ impl Parse for Dasharray {
type Data = ();
type Err = AttributeError;
- fn parse(parser: &mut Parser, _: Self::Data) -> Result<Dasharray, AttributeError> {
+ fn parse(parser: &mut Parser<'_, '_>, _: Self::Data) -> Result<Dasharray, AttributeError> {
if parser.try(|p| p.expect_ident_matching("none")).is_ok() {
Ok(Dasharray::None)
} else {
@@ -280,7 +280,7 @@ impl Parse for Dasharray {
}
// This does not handle "inherit" or "none" state, the caller is responsible for that.
-fn parse_dash_array(parser: &mut Parser) -> Result<Vec<Length>, AttributeError> {
+fn parse_dash_array(parser: &mut Parser<'_, '_>) -> Result<Vec<Length>, AttributeError> {
let mut dasharray = Vec::new();
loop {
diff --git a/rsvg_internals/src/link.rs b/rsvg_internals/src/link.rs
index b4ec2c49..216232a8 100644
--- a/rsvg_internals/src/link.rs
+++ b/rsvg_internals/src/link.rs
@@ -27,7 +27,7 @@ impl NodeLink {
}
impl NodeTrait for NodeLink {
- fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag) -> NodeResult {
+ fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag<'_>) -> NodeResult {
for (_key, attr, value) in pbag.iter() {
match attr {
Attribute::XlinkHref => *self.link.borrow_mut() = Some(value.to_owned()),
@@ -42,8 +42,8 @@ impl NodeTrait for NodeLink {
fn draw(
&self,
node: &RsvgNode,
- cascaded: &CascadedValues,
- draw_ctx: &mut DrawingCtx,
+ cascaded: &CascadedValues<'_>,
+ draw_ctx: &mut DrawingCtx<'_>,
clipping: bool,
) -> Result<(), RenderingError> {
let link = self.link.borrow();
@@ -74,12 +74,12 @@ impl NodeTrait for NodeLink {
}
/// escape quotes and backslashes with backslash
-fn escape_value(value: &str) -> Cow<str> {
+fn escape_value(value: &str) -> Cow<'_, str> {
lazy_static! {
static ref REGEX: Regex = Regex::new(r"['\\]").unwrap();
}
- REGEX.replace_all(value, |caps: &Captures| {
+ REGEX.replace_all(value, |caps: &Captures<'_>| {
match caps.get(0).unwrap().as_str() {
"'" => "\\'".to_owned(),
"\\" => "\\\\".to_owned(),
diff --git a/rsvg_internals/src/load.rs b/rsvg_internals/src/load.rs
index 43e0bcdc..b3807701 100644
--- a/rsvg_internals/src/load.rs
+++ b/rsvg_internals/src/load.rs
@@ -269,7 +269,7 @@ lazy_static! {
pub extern "C" fn rsvg_load_new_node(
raw_name: *const libc::c_char,
parent: *const RsvgNode,
- pbag: *const PropertyBag,
+ pbag: *const PropertyBag<'_>,
defs: *mut RsvgDefs,
out_is_svg: *mut glib_sys::gboolean,
) -> *const RsvgNode {
@@ -334,7 +334,7 @@ pub extern "C" fn rsvg_load_set_node_atts(
handle: *const RsvgHandle,
raw_node: *mut RsvgNode,
tag: *const libc::c_char,
- pbag: *const PropertyBag,
+ pbag: *const PropertyBag<'_>,
) {
assert!(!raw_node.is_null());
assert!(!pbag.is_null());
diff --git a/rsvg_internals/src/marker.rs b/rsvg_internals/src/marker.rs
index d2d0ddc9..9367bd87 100644
--- a/rsvg_internals/src/marker.rs
+++ b/rsvg_internals/src/marker.rs
@@ -38,7 +38,7 @@ impl Parse for MarkerUnits {
type Data = ();
type Err = AttributeError;
- fn parse(parser: &mut Parser, _: ()) -> Result<MarkerUnits, AttributeError> {
+ fn parse(parser: &mut Parser<'_, '_>, _: ()) -> Result<MarkerUnits, AttributeError> {
let loc = parser.current_source_location();
parser
@@ -76,7 +76,7 @@ impl Parse for MarkerOrient {
type Data = ();
type Err = AttributeError;
- fn parse(parser: &mut Parser, _: ()) -> Result<MarkerOrient, AttributeError> {
+ fn parse(parser: &mut Parser<'_, '_>, _: ()) -> Result<MarkerOrient, AttributeError> {
if parser.try(|p| p.expect_ident_matching("auto")).is_ok() {
Ok(MarkerOrient::Auto)
} else {
@@ -120,7 +120,7 @@ impl NodeMarker {
fn render(
&self,
node: &RsvgNode,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
xpos: f64,
ypos: f64,
computed_angle: f64,
@@ -202,7 +202,7 @@ impl NodeMarker {
}
impl NodeTrait for NodeMarker {
- fn set_atts(&self, node: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag) -> NodeResult {
+ fn set_atts(&self, node: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag<'_>) -> NodeResult {
// marker element has overflow:hidden
// https://www.w3.org/TR/SVG/styling.html#UAStyleSheet
node.set_overflow_hidden();
@@ -622,7 +622,7 @@ enum MarkerType {
}
fn emit_marker_by_name(
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
name: &str,
xpos: f64,
ypos: f64,
@@ -679,7 +679,7 @@ where
pub fn render_markers_for_path_builder(
builder: &PathBuilder,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
values: &ComputedValues,
clipping: bool,
) -> Result<(), RenderingError> {
diff --git a/rsvg_internals/src/mask.rs b/rsvg_internals/src/mask.rs
index 8fcece25..453ec64d 100644
--- a/rsvg_internals/src/mask.rs
+++ b/rsvg_internals/src/mask.rs
@@ -70,7 +70,7 @@ impl NodeMask {
&self,
node: &RsvgNode,
affine_before_mask: &cairo::Matrix,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
) -> Result<(), RenderingError> {
let cascaded = node.get_cascaded_values();
let values = cascaded.get();
@@ -245,7 +245,7 @@ fn compute_luminance_to_alpha(
}
impl NodeTrait for NodeMask {
- fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag) -> NodeResult {
+ fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag<'_>) -> NodeResult {
for (_key, attr, value) in pbag.iter() {
match attr {
Attribute::X => self.x.set(parse("x", value, LengthDir::Horizontal)?),
diff --git a/rsvg_internals/src/node.rs b/rsvg_internals/src/node.rs
index c5182e2d..200b086b 100644
--- a/rsvg_internals/src/node.rs
+++ b/rsvg_internals/src/node.rs
@@ -70,7 +70,7 @@ impl<'a> CascadedValues<'a> {
/// This is to be used only in the toplevel drawing function, or in elements like `<marker>`
/// that don't propagate their parent's cascade to their children. All others should use
/// `new()` to derive the cascade from an existing one.
- fn new_from_node(node: &Node) -> CascadedValues {
+ fn new_from_node(node: &Node) -> CascadedValues<'_> {
CascadedValues {
inner: CascadedInner::FromNode(node.values.borrow()),
}
@@ -112,7 +112,7 @@ pub trait NodeTrait: Downcast {
&self,
node: &RsvgNode,
handle: *const RsvgHandle,
- pbag: &PropertyBag,
+ pbag: &PropertyBag<'_>,
) -> NodeResult;
/// Sets any special-cased properties that the node may have, that are different
@@ -126,8 +126,8 @@ pub trait NodeTrait: Downcast {
fn draw(
&self,
_node: &RsvgNode,
- _cascaded: &CascadedValues,
- _draw_ctx: &mut DrawingCtx,
+ _cascaded: &CascadedValues<'_>,
+ _draw_ctx: &mut DrawingCtx<'_>,
_clipping: bool,
) -> Result<(), RenderingError> {
// by default nodes don't draw themselves
@@ -289,7 +289,7 @@ impl Node {
self.transform.get()
}
- pub fn get_cascaded_values(&self) -> CascadedValues {
+ pub fn get_cascaded_values(&self) -> CascadedValues<'_> {
CascadedValues::new_from_node(self)
}
@@ -343,7 +343,7 @@ impl Node {
self.first_child.replace(Some(child.clone()));
}
- pub fn set_atts(&self, node: &RsvgNode, handle: *const RsvgHandle, pbag: &PropertyBag) {
+ pub fn set_atts(&self, node: &RsvgNode, handle: *const RsvgHandle, pbag: &PropertyBag<'_>) {
for (_key, attr, value) in pbag.iter() {
match attr {
Attribute::Transform => match Matrix::parse_str(value, ()) {
@@ -375,7 +375,7 @@ impl Node {
}
}
- fn parse_conditional_processing_attributes(&self, pbag: &PropertyBag) -> Result<(), NodeError> {
+ fn parse_conditional_processing_attributes(&self, pbag: &PropertyBag<'_>) -> Result<(), NodeError> {
let mut cond = self.cond.get();
for (_key, attr, value) in pbag.iter() {
@@ -413,7 +413,7 @@ impl Node {
// Sets the node's state from the attributes in the pbag. Also applies
// CSS rules in our limited way based on the node's tag/class/id.
- pub fn parse_style_attributes(&self, handle: *const RsvgHandle, tag: &str, pbag: &PropertyBag) {
+ pub fn parse_style_attributes(&self, handle: *const RsvgHandle, tag: &str, pbag: &PropertyBag<'_>) {
{
let mut state = self.state.borrow_mut();
match state.parse_presentation_attributes(pbag) {
@@ -529,8 +529,8 @@ impl Node {
pub fn draw(
&self,
node: &RsvgNode,
- cascaded: &CascadedValues,
- draw_ctx: &mut DrawingCtx,
+ cascaded: &CascadedValues<'_>,
+ draw_ctx: &mut DrawingCtx<'_>,
clipping: bool,
) -> Result<(), RenderingError> {
if !self.is_in_error() {
@@ -586,8 +586,8 @@ impl Node {
pub fn draw_children(
&self,
- cascaded: &CascadedValues,
- draw_ctx: &mut DrawingCtx,
+ cascaded: &CascadedValues<'_>,
+ draw_ctx: &mut DrawingCtx<'_>,
clipping: bool,
) -> Result<(), RenderingError> {
for child in self.children() {
@@ -839,7 +839,7 @@ mod tests {
struct TestNodeImpl {}
impl NodeTrait for TestNodeImpl {
- fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, _: &PropertyBag) -> NodeResult {
+ fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, _: &PropertyBag<'_>) -> NodeResult {
Ok(())
}
}
diff --git a/rsvg_internals/src/paint_server.rs b/rsvg_internals/src/paint_server.rs
index 00567e9e..1ba16944 100644
--- a/rsvg_internals/src/paint_server.rs
+++ b/rsvg_internals/src/paint_server.rs
@@ -23,7 +23,7 @@ impl Parse for PaintServer {
type Data = ();
type Err = AttributeError;
- fn parse(parser: &mut Parser, _: ()) -> Result<PaintServer, AttributeError> {
+ fn parse(parser: &mut Parser<'_, '_>, _: ()) -> Result<PaintServer, AttributeError> {
if parser.try(|i| i.expect_ident_matching("none")).is_ok() {
Ok(PaintServer::None)
} else if let Ok(url) = parser.try(|i| i.expect_url()) {
@@ -50,7 +50,7 @@ impl Parse for PaintServer {
}
fn set_color(
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
color: &cssparser::Color,
opacity: &UnitInterval,
current_color: &cssparser::RGBA,
@@ -70,7 +70,7 @@ fn set_color(
}
pub fn set_source_paint_server(
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
ps: &PaintServer,
opacity: &UnitInterval,
bbox: &BoundingBox,
diff --git a/rsvg_internals/src/parsers.rs b/rsvg_internals/src/parsers.rs
index 66958318..c9b93bcd 100644
--- a/rsvg_internals/src/parsers.rs
+++ b/rsvg_internals/src/parsers.rs
@@ -24,7 +24,7 @@ impl ParseError {
}
impl<'a> From<BasicParseError<'a>> for ParseError {
- fn from(_: BasicParseError) -> ParseError {
+ fn from(_: BasicParseError<'_>) -> ParseError {
ParseError::new("parse error")
}
}
@@ -33,7 +33,7 @@ pub trait Parse: Sized {
type Data;
type Err;
- fn parse(parser: &mut Parser, data: Self::Data) -> Result<Self, Self::Err>;
+ fn parse(parser: &mut Parser<'_, '_>, data: Self::Data) -> Result<Self, Self::Err>;
fn parse_str(s: &str, data: Self::Data) -> Result<Self, Self::Err> {
let mut input = ParserInput::new(s);
@@ -50,7 +50,7 @@ impl Parse for f64 {
type Data = ();
type Err = AttributeError;
- fn parse(parser: &mut Parser, _: ()) -> Result<f64, AttributeError> {
+ fn parse(parser: &mut Parser<'_, '_>, _: ()) -> Result<f64, AttributeError> {
Ok(f64::from(parser.expect_number().map_err(|_| {
AttributeError::Parse(ParseError::new("expected number"))
})?))
@@ -61,7 +61,7 @@ impl Parse for String {
type Data = ();
type Err = AttributeError;
- fn parse(parser: &mut Parser, _: ()) -> Result<String, AttributeError> {
+ fn parse(parser: &mut Parser<'_, '_>, _: ()) -> Result<String, AttributeError> {
Ok(String::from(
parser
.expect_string()
@@ -121,7 +121,7 @@ where
//
// Returns an f64 angle in degrees
-pub fn angle_degrees(parser: &mut Parser) -> Result<f64, ParseError> {
+pub fn angle_degrees(parser: &mut Parser<'_, '_>) -> Result<f64, ParseError> {
let angle = {
let token = parser
.next()
@@ -154,7 +154,7 @@ pub fn angle_degrees(parser: &mut Parser) -> Result<f64, ParseError> {
Ok(angle)
}
-pub fn optional_comma(parser: &mut Parser) {
+pub fn optional_comma(parser: &mut Parser<'_, '_>) {
let _ = parser.try(|p| p.expect_comma());
}
@@ -309,7 +309,7 @@ pub enum NumberListError {
Parse(ParseError),
}
-pub fn number_list(parser: &mut Parser, length: ListLength) -> Result<Vec<f64>, NumberListError> {
+pub fn number_list(parser: &mut Parser<'_, '_>, length: ListLength) -> Result<Vec<f64>, NumberListError> {
let n;
match length {
diff --git a/rsvg_internals/src/path_parser.rs b/rsvg_internals/src/path_parser.rs
index db715a56..5207f27f 100644
--- a/rsvg_internals/src/path_parser.rs
+++ b/rsvg_internals/src/path_parser.rs
@@ -913,7 +913,7 @@ impl Error for ParseError {
}
impl Display for ParseError {
- fn fmt(&self, f: &mut Formatter) -> fmt::Result {
+ fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
write!(
f,
"error at position {}: {}",
diff --git a/rsvg_internals/src/pattern.rs b/rsvg_internals/src/pattern.rs
index 5248778b..5c290093 100644
--- a/rsvg_internals/src/pattern.rs
+++ b/rsvg_internals/src/pattern.rs
@@ -170,7 +170,7 @@ impl NodePattern {
}
impl NodeTrait for NodePattern {
- fn set_atts(&self, node: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag) -> NodeResult {
+ fn set_atts(&self, node: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag<'_>) -> NodeResult {
// pattern element has overflow:hidden
// https://www.w3.org/TR/SVG/styling.html#UAStyleSheet
node.set_overflow_hidden();
@@ -229,7 +229,7 @@ impl NodeTrait for NodePattern {
}
}
-fn resolve_pattern(pattern: &Pattern, draw_ctx: &mut DrawingCtx) -> Pattern {
+fn resolve_pattern(pattern: &Pattern, draw_ctx: &mut DrawingCtx<'_>) -> Pattern {
let mut result = pattern.clone();
while !result.is_resolved() {
@@ -251,7 +251,7 @@ fn resolve_pattern(pattern: &Pattern, draw_ctx: &mut DrawingCtx) -> Pattern {
fn set_pattern_on_draw_context(
pattern: &Pattern,
values: &ComputedValues,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
bbox: &BoundingBox,
) -> Result<bool, RenderingError> {
assert!(pattern.is_resolved());
@@ -433,7 +433,7 @@ fn set_pattern_on_draw_context(
fn resolve_fallbacks_and_set_pattern(
pattern: &Pattern,
values: &ComputedValues,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
bbox: &BoundingBox,
) -> Result<bool, RenderingError> {
let resolved = resolve_pattern(pattern, draw_ctx);
@@ -443,7 +443,7 @@ fn resolve_fallbacks_and_set_pattern(
pub fn pattern_resolve_fallbacks_and_set_pattern(
node: &RsvgNode,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
bbox: &BoundingBox,
) -> Result<bool, RenderingError> {
assert!(node.get_type() == NodeType::Pattern);
diff --git a/rsvg_internals/src/property_bag.rs b/rsvg_internals/src/property_bag.rs
index 4b8d8514..d11a8b14 100644
--- a/rsvg_internals/src/property_bag.rs
+++ b/rsvg_internals/src/property_bag.rs
@@ -83,7 +83,7 @@ impl<'a> PropertyBag<'a> {
PropertyBag(array)
}
- pub fn from_owned(owned: &OwnedPropertyBag) -> PropertyBag {
+ pub fn from_owned(owned: &OwnedPropertyBag) -> PropertyBag<'_> {
let mut array = Vec::new();
for &(ref k, a, ref v) in &owned.0 {
@@ -103,19 +103,19 @@ impl<'a> PropertyBag<'a> {
OwnedPropertyBag(array)
}
- pub fn ffi(&self) -> *const PropertyBag {
- self as *const PropertyBag
+ pub fn ffi(&self) -> *const PropertyBag<'_> {
+ self as *const PropertyBag<'_>
}
pub fn len(&self) -> usize {
self.0.len()
}
- pub fn iter(&self) -> PropertyBagIter {
+ pub fn iter(&self) -> PropertyBagIter<'_> {
PropertyBagIter(self.cstr_iter())
}
- pub fn cstr_iter(&self) -> PropertyBagCStrIter {
+ pub fn cstr_iter(&self) -> PropertyBagCStrIter<'_> {
PropertyBagCStrIter(self.0.iter())
}
}
@@ -147,7 +147,7 @@ pub extern "C" fn rsvg_property_bag_new<'a>(
}
#[no_mangle]
-pub extern "C" fn rsvg_property_bag_free(pbag: *mut PropertyBag) {
+pub extern "C" fn rsvg_property_bag_free(pbag: *mut PropertyBag<'_>) {
unsafe {
let _ = Box::from_raw(pbag);
}
@@ -155,8 +155,8 @@ pub extern "C" fn rsvg_property_bag_free(pbag: *mut PropertyBag) {
#[no_mangle]
pub extern "C" fn rsvg_property_bag_iter_begin(
- pbag: *const PropertyBag,
-) -> *mut PropertyBagCStrIter {
+ pbag: *const PropertyBag<'_>,
+) -> *mut PropertyBagCStrIter<'_> {
assert!(!pbag.is_null());
let pbag = unsafe { &*pbag };
@@ -165,7 +165,7 @@ pub extern "C" fn rsvg_property_bag_iter_begin(
#[no_mangle]
pub extern "C" fn rsvg_property_bag_iter_next(
- iter: *mut PropertyBagCStrIter,
+ iter: *mut PropertyBagCStrIter<'_>,
out_key: *mut *const libc::c_char,
out_attr: *mut Attribute,
out_value: *mut *const libc::c_char,
@@ -190,7 +190,7 @@ pub extern "C" fn rsvg_property_bag_iter_next(
}
#[no_mangle]
-pub extern "C" fn rsvg_property_bag_iter_end(iter: *mut PropertyBagCStrIter) {
+pub extern "C" fn rsvg_property_bag_iter_end(iter: *mut PropertyBagCStrIter<'_>) {
assert!(!iter.is_null());
unsafe { Box::from_raw(iter) };
diff --git a/rsvg_internals/src/property_macros.rs b/rsvg_internals/src/property_macros.rs
index 9841b47f..04a86e93 100644
--- a/rsvg_internals/src/property_macros.rs
+++ b/rsvg_internals/src/property_macros.rs
@@ -14,7 +14,7 @@ pub trait Property<T> {
/// make_property!(
/// StrokeLinejoin,
/// default: Miter,
-///
+///
/// "miter" => Miter,
/// "round" => Round,
/// "bevel" => Bevel,
@@ -47,7 +47,7 @@ macro_rules! make_property {
type Data = ();
type Err = ::error::AttributeError;
- fn parse(parser: &mut ::cssparser::Parser, _: Self::Data) -> Result<$name,
::error::AttributeError> {
+ fn parse(parser: &mut ::cssparser::Parser<'_, '_>, _: Self::Data) -> Result<$name,
::error::AttributeError> {
let loc = parser.current_source_location();
parser
@@ -97,7 +97,7 @@ macro_rules! make_property {
type Data = $parse_data_type;
type Err = ::error::AttributeError;
- fn parse(parser: &mut ::cssparser::Parser, d: Self::Data) -> Result<$name,
::error::AttributeError> {
+ fn parse(parser: &mut ::cssparser::Parser<'_, '_>, d: Self::Data) -> Result<$name,
::error::AttributeError> {
Ok($name(<$type as ::parsers::Parse>::parse(parser, d)?))
}
}
@@ -121,7 +121,7 @@ macro_rules! make_property {
type Data = $parse_data_type;
type Err = ::error::AttributeError;
- fn parse(parser: &mut ::cssparser::Parser, d: Self::Data) -> Result<$name,
::error::AttributeError> {
+ fn parse(parser: &mut ::cssparser::Parser<'_, '_>, d: Self::Data) -> Result<$name,
::error::AttributeError> {
Ok($name(<$type as ::parsers::Parse>::parse(parser, d)?))
}
}
diff --git a/rsvg_internals/src/shapes.rs b/rsvg_internals/src/shapes.rs
index b393f78e..87e40ae8 100644
--- a/rsvg_internals/src/shapes.rs
+++ b/rsvg_internals/src/shapes.rs
@@ -17,7 +17,7 @@ use state::ComputedValues;
fn render_path_builder(
builder: &PathBuilder,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
node: &RsvgNode,
values: &ComputedValues,
render_markers: bool,
@@ -51,7 +51,7 @@ fn render_ellipse(
cy: f64,
rx: f64,
ry: f64,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
node: &RsvgNode,
values: &ComputedValues,
clipping: bool,
@@ -123,7 +123,7 @@ impl NodePath {
}
impl NodeTrait for NodePath {
- fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag) -> NodeResult {
+ fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag<'_>) -> NodeResult {
for (_key, attr, value) in pbag.iter() {
if attr == Attribute::D {
let mut builder = PathBuilder::new();
@@ -143,8 +143,8 @@ impl NodeTrait for NodePath {
fn draw(
&self,
node: &RsvgNode,
- cascaded: &CascadedValues,
- draw_ctx: &mut DrawingCtx,
+ cascaded: &CascadedValues<'_>,
+ draw_ctx: &mut DrawingCtx<'_>,
clipping: bool,
) -> Result<(), RenderingError> {
let values = cascaded.get();
@@ -185,7 +185,7 @@ impl NodePoly {
}
impl NodeTrait for NodePoly {
- fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag) -> NodeResult {
+ fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag<'_>) -> NodeResult {
for (_key, attr, value) in pbag.iter() {
// support for svg < 1.0 which used verts
if attr == Attribute::Points || attr == Attribute::Verts {
@@ -210,8 +210,8 @@ impl NodeTrait for NodePoly {
fn draw(
&self,
node: &RsvgNode,
- cascaded: &CascadedValues,
- draw_ctx: &mut DrawingCtx,
+ cascaded: &CascadedValues<'_>,
+ draw_ctx: &mut DrawingCtx<'_>,
clipping: bool,
) -> Result<(), RenderingError> {
let values = cascaded.get();
@@ -257,7 +257,7 @@ impl NodeLine {
}
impl NodeTrait for NodeLine {
- fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag) -> NodeResult {
+ fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag<'_>) -> NodeResult {
for (_key, attr, value) in pbag.iter() {
match attr {
Attribute::X1 => self.x1.set(parse("x1", value, LengthDir::Horizontal)?),
@@ -274,8 +274,8 @@ impl NodeTrait for NodeLine {
fn draw(
&self,
node: &RsvgNode,
- cascaded: &CascadedValues,
- draw_ctx: &mut DrawingCtx,
+ cascaded: &CascadedValues<'_>,
+ draw_ctx: &mut DrawingCtx<'_>,
clipping: bool,
) -> Result<(), RenderingError> {
let values = cascaded.get();
@@ -323,7 +323,7 @@ impl NodeRect {
}
impl NodeTrait for NodeRect {
- fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag) -> NodeResult {
+ fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag<'_>) -> NodeResult {
for (_key, attr, value) in pbag.iter() {
match attr {
Attribute::X => self.x.set(parse("x", value, LengthDir::Horizontal)?),
@@ -364,8 +364,8 @@ impl NodeTrait for NodeRect {
fn draw(
&self,
node: &RsvgNode,
- cascaded: &CascadedValues,
- draw_ctx: &mut DrawingCtx,
+ cascaded: &CascadedValues<'_>,
+ draw_ctx: &mut DrawingCtx<'_>,
clipping: bool,
) -> Result<(), RenderingError> {
let values = cascaded.get();
@@ -526,7 +526,7 @@ impl NodeCircle {
}
impl NodeTrait for NodeCircle {
- fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag) -> NodeResult {
+ fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag<'_>) -> NodeResult {
for (_key, attr, value) in pbag.iter() {
match attr {
Attribute::Cx => self.cx.set(parse("cx", value, LengthDir::Horizontal)?),
@@ -548,8 +548,8 @@ impl NodeTrait for NodeCircle {
fn draw(
&self,
node: &RsvgNode,
- cascaded: &CascadedValues,
- draw_ctx: &mut DrawingCtx,
+ cascaded: &CascadedValues<'_>,
+ draw_ctx: &mut DrawingCtx<'_>,
clipping: bool,
) -> Result<(), RenderingError> {
let values = cascaded.get();
@@ -583,7 +583,7 @@ impl NodeEllipse {
}
impl NodeTrait for NodeEllipse {
- fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag) -> NodeResult {
+ fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag<'_>) -> NodeResult {
for (_key, attr, value) in pbag.iter() {
match attr {
Attribute::Cx => self.cx.set(parse("cx", value, LengthDir::Horizontal)?),
@@ -612,8 +612,8 @@ impl NodeTrait for NodeEllipse {
fn draw(
&self,
node: &RsvgNode,
- cascaded: &CascadedValues,
- draw_ctx: &mut DrawingCtx,
+ cascaded: &CascadedValues<'_>,
+ draw_ctx: &mut DrawingCtx<'_>,
clipping: bool,
) -> Result<(), RenderingError> {
let values = cascaded.get();
diff --git a/rsvg_internals/src/state.rs b/rsvg_internals/src/state.rs
index 1593bb1c..fb11743e 100644
--- a/rsvg_internals/src/state.rs
+++ b/rsvg_internals/src/state.rs
@@ -539,7 +539,7 @@ impl State {
Ok(())
}
- pub fn parse_presentation_attributes(&mut self, pbag: &PropertyBag) -> Result<(), NodeError> {
+ pub fn parse_presentation_attributes(&mut self, pbag: &PropertyBag<'_>) -> Result<(), NodeError> {
for (_key, attr, value) in pbag.iter() {
self.parse_attribute_pair(attr, value, false)?;
}
@@ -662,7 +662,7 @@ make_property!(
// These values come from Inkscape's SP_CSS_BASELINE_SHIFT_(SUB/SUPER/BASELINE);
// see sp_style_merge_baseline_shift_from_parent()
- fn parse(parser: &mut Parser, _: Self::Data) -> Result<BaselineShift, ::error::AttributeError> {
+ fn parse(parser: &mut Parser<'_, '_>, _: Self::Data) -> Result<BaselineShift,
::error::AttributeError> {
let parser_state = parser.state();
{
@@ -1225,7 +1225,7 @@ make_property!(
type Data = ();
type Err = AttributeError;
- fn parse(parser: &mut Parser, _: Self::Data) -> Result<TextDecoration, AttributeError> {
+ fn parse(parser: &mut Parser<'_, '_>, _: Self::Data) -> Result<TextDecoration, AttributeError> {
let mut overline = false;
let mut underline = false;
let mut strike = false;
diff --git a/rsvg_internals/src/stop.rs b/rsvg_internals/src/stop.rs
index 44d5c8b1..7ed2aaab 100644
--- a/rsvg_internals/src/stop.rs
+++ b/rsvg_internals/src/stop.rs
@@ -45,7 +45,7 @@ fn validate_offset(length: Length) -> Result<Length, AttributeError> {
}
impl NodeTrait for NodeStop {
- fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag) -> NodeResult {
+ fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag<'_>) -> NodeResult {
for (_key, attr, value) in pbag.iter() {
match attr {
Attribute::Offset => {
diff --git a/rsvg_internals/src/structure.rs b/rsvg_internals/src/structure.rs
index 601de3c9..325bf02b 100644
--- a/rsvg_internals/src/structure.rs
+++ b/rsvg_internals/src/structure.rs
@@ -28,15 +28,15 @@ impl NodeGroup {
}
impl NodeTrait for NodeGroup {
- fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, _: &PropertyBag) -> NodeResult {
+ fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, _: &PropertyBag<'_>) -> NodeResult {
Ok(())
}
fn draw(
&self,
node: &RsvgNode,
- cascaded: &CascadedValues,
- draw_ctx: &mut DrawingCtx,
+ cascaded: &CascadedValues<'_>,
+ draw_ctx: &mut DrawingCtx<'_>,
clipping: bool,
) -> Result<(), RenderingError> {
let values = cascaded.get();
@@ -56,7 +56,7 @@ impl NodeDefs {
}
impl NodeTrait for NodeDefs {
- fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, _: &PropertyBag) -> NodeResult {
+ fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, _: &PropertyBag<'_>) -> NodeResult {
Ok(())
}
}
@@ -70,15 +70,15 @@ impl NodeSwitch {
}
impl NodeTrait for NodeSwitch {
- fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, _: &PropertyBag) -> NodeResult {
+ fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, _: &PropertyBag<'_>) -> NodeResult {
Ok(())
}
fn draw(
&self,
node: &RsvgNode,
- cascaded: &CascadedValues,
- draw_ctx: &mut DrawingCtx,
+ cascaded: &CascadedValues<'_>,
+ draw_ctx: &mut DrawingCtx<'_>,
clipping: bool,
) -> Result<(), RenderingError> {
let values = cascaded.get();
@@ -125,7 +125,7 @@ impl NodeSvg {
}
impl NodeTrait for NodeSvg {
- fn set_atts(&self, node: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag) -> NodeResult {
+ fn set_atts(&self, node: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag<'_>) -> NodeResult {
// SVG element has overflow:hidden
// https://www.w3.org/TR/SVG/styling.html#UAStyleSheet
node.set_overflow_hidden();
@@ -183,8 +183,8 @@ impl NodeTrait for NodeSvg {
fn draw(
&self,
node: &RsvgNode,
- cascaded: &CascadedValues,
- draw_ctx: &mut DrawingCtx,
+ cascaded: &CascadedValues<'_>,
+ draw_ctx: &mut DrawingCtx<'_>,
clipping: bool,
) -> Result<(), RenderingError> {
let values = cascaded.get();
@@ -241,7 +241,7 @@ impl NodeUse {
}
impl NodeTrait for NodeUse {
- fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag) -> NodeResult {
+ fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag<'_>) -> NodeResult {
for (_key, attr, value) in pbag.iter() {
match attr {
Attribute::XlinkHref => *self.link.borrow_mut() = Some(value.to_owned()),
@@ -276,8 +276,8 @@ impl NodeTrait for NodeUse {
fn draw(
&self,
node: &RsvgNode,
- cascaded: &CascadedValues,
- draw_ctx: &mut DrawingCtx,
+ cascaded: &CascadedValues<'_>,
+ draw_ctx: &mut DrawingCtx<'_>,
clipping: bool,
) -> Result<(), RenderingError> {
let values = cascaded.get();
@@ -389,7 +389,7 @@ impl NodeSymbol {
}
impl NodeTrait for NodeSymbol {
- fn set_atts(&self, node: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag) -> NodeResult {
+ fn set_atts(&self, node: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag<'_>) -> NodeResult {
// symbol element has overflow:hidden
// https://www.w3.org/TR/SVG/styling.html#UAStyleSheet
node.set_overflow_hidden();
diff --git a/rsvg_internals/src/surface_utils/shared_surface.rs
b/rsvg_internals/src/surface_utils/shared_surface.rs
index d331ad74..e90f4345 100644
--- a/rsvg_internals/src/surface_utils/shared_surface.rs
+++ b/rsvg_internals/src/surface_utils/shared_surface.rs
@@ -791,7 +791,7 @@ impl SharedImageSurface {
/// # Safety
/// The returned pointer must not be used to modify the surface.
#[inline]
- pub unsafe fn to_glib_none(&self) -> Stash<*mut cairo_sys::cairo_surface_t, ImageSurface> {
+ pub unsafe fn to_glib_none(&self) -> Stash<'_, *mut cairo_sys::cairo_surface_t, ImageSurface> {
self.surface.to_glib_none()
}
}
diff --git a/rsvg_internals/src/text.rs b/rsvg_internals/src/text.rs
index 168255cc..fe997e9c 100644
--- a/rsvg_internals/src/text.rs
+++ b/rsvg_internals/src/text.rs
@@ -67,7 +67,7 @@ impl NodeChars {
&self,
_node: &RsvgNode,
values: &ComputedValues,
- draw_ctx: &DrawingCtx,
+ draw_ctx: &DrawingCtx<'_>,
length: &mut f64,
) {
let s = self.string.borrow();
@@ -81,7 +81,7 @@ impl NodeChars {
&self,
_node: &RsvgNode,
values: &ComputedValues,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
x: &mut f64,
y: &mut f64,
clipping: bool,
@@ -109,7 +109,7 @@ impl NodeChars {
}
impl NodeTrait for NodeChars {
- fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, _: &PropertyBag) -> NodeResult {
+ fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, _: &PropertyBag<'_>) -> NodeResult {
Ok(())
}
}
@@ -133,7 +133,7 @@ impl NodeText {
}
impl NodeTrait for NodeText {
- fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag) -> NodeResult {
+ fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag<'_>) -> NodeResult {
for (_key, attr, value) in pbag.iter() {
match attr {
Attribute::X => self.x.set(parse("x", value, LengthDir::Horizontal)?),
@@ -154,8 +154,8 @@ impl NodeTrait for NodeText {
fn draw(
&self,
node: &RsvgNode,
- cascaded: &CascadedValues,
- draw_ctx: &mut DrawingCtx,
+ cascaded: &CascadedValues<'_>,
+ draw_ctx: &mut DrawingCtx<'_>,
clipping: bool,
) -> Result<(), RenderingError> {
let values = cascaded.get();
@@ -208,8 +208,8 @@ impl NodeTRef {
fn measure(
&self,
_node: &RsvgNode,
- cascaded: &CascadedValues,
- draw_ctx: &mut DrawingCtx,
+ cascaded: &CascadedValues<'_>,
+ draw_ctx: &mut DrawingCtx<'_>,
length: &mut f64,
) -> bool {
let l = self.link.borrow();
@@ -231,8 +231,8 @@ impl NodeTRef {
fn render(
&self,
_node: &RsvgNode,
- cascaded: &CascadedValues,
- draw_ctx: &mut DrawingCtx,
+ cascaded: &CascadedValues<'_>,
+ draw_ctx: &mut DrawingCtx<'_>,
x: &mut f64,
y: &mut f64,
clipping: bool,
@@ -253,7 +253,7 @@ impl NodeTRef {
}
impl NodeTrait for NodeTRef {
- fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag) -> NodeResult {
+ fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag<'_>) -> NodeResult {
for (_key, attr, value) in pbag.iter() {
match attr {
Attribute::XlinkHref => *self.link.borrow_mut() = Some(value.to_owned()),
@@ -285,8 +285,8 @@ impl NodeTSpan {
fn measure(
&self,
node: &RsvgNode,
- cascaded: &CascadedValues,
- draw_ctx: &mut DrawingCtx,
+ cascaded: &CascadedValues<'_>,
+ draw_ctx: &mut DrawingCtx<'_>,
length: &mut f64,
usetextonly: bool,
) -> bool {
@@ -310,8 +310,8 @@ impl NodeTSpan {
fn render(
&self,
node: &RsvgNode,
- cascaded: &CascadedValues,
- draw_ctx: &mut DrawingCtx,
+ cascaded: &CascadedValues<'_>,
+ draw_ctx: &mut DrawingCtx<'_>,
x: &mut f64,
y: &mut f64,
usetextonly: bool,
@@ -360,7 +360,7 @@ impl NodeTSpan {
}
impl NodeTrait for NodeTSpan {
- fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag) -> NodeResult {
+ fn set_atts(&self, _: &RsvgNode, _: *const RsvgHandle, pbag: &PropertyBag<'_>) -> NodeResult {
for (_key, attr, value) in pbag.iter() {
match attr {
Attribute::X => self
@@ -485,7 +485,7 @@ impl From<WritingMode> for pango::Gravity {
}
fn create_pango_layout(
- draw_ctx: &DrawingCtx,
+ draw_ctx: &DrawingCtx<'_>,
values: &ComputedValues,
text: &str,
) -> pango::Layout {
@@ -564,8 +564,8 @@ fn create_pango_layout(
fn anchor_offset(
node: &RsvgNode,
- cascaded: &CascadedValues,
- draw_ctx: &mut DrawingCtx,
+ cascaded: &CascadedValues<'_>,
+ draw_ctx: &mut DrawingCtx<'_>,
anchor: TextAnchor,
textonly: bool,
) -> f64 {
@@ -587,8 +587,8 @@ fn anchor_offset(
fn measure_children(
node: &RsvgNode,
- cascaded: &CascadedValues,
- draw_ctx: &mut DrawingCtx,
+ cascaded: &CascadedValues<'_>,
+ draw_ctx: &mut DrawingCtx<'_>,
length: &mut f64,
textonly: bool,
) -> bool {
@@ -612,8 +612,8 @@ fn measure_children(
fn measure_child(
node: &RsvgNode,
- cascaded: &CascadedValues,
- draw_ctx: &mut DrawingCtx,
+ cascaded: &CascadedValues<'_>,
+ draw_ctx: &mut DrawingCtx<'_>,
length: &mut f64,
textonly: bool,
) -> bool {
@@ -669,8 +669,8 @@ fn measure_child(
fn render_children(
node: &RsvgNode,
- cascaded: &CascadedValues,
- draw_ctx: &mut DrawingCtx,
+ cascaded: &CascadedValues<'_>,
+ draw_ctx: &mut DrawingCtx<'_>,
x: &mut f64,
y: &mut f64,
textonly: bool,
@@ -689,8 +689,8 @@ fn render_children(
fn render_child(
node: &RsvgNode,
- cascaded: &CascadedValues,
- draw_ctx: &mut DrawingCtx,
+ cascaded: &CascadedValues<'_>,
+ draw_ctx: &mut DrawingCtx<'_>,
x: &mut f64,
y: &mut f64,
textonly: bool,
diff --git a/rsvg_internals/src/transform.rs b/rsvg_internals/src/transform.rs
index b747375d..b4c07040 100644
--- a/rsvg_internals/src/transform.rs
+++ b/rsvg_internals/src/transform.rs
@@ -12,7 +12,7 @@ impl Parse for cairo::Matrix {
type Data = ();
type Err = AttributeError;
- fn parse(parser: &mut Parser, _: ()) -> Result<cairo::Matrix, AttributeError> {
+ fn parse(parser: &mut Parser<'_, '_>, _: ()) -> Result<cairo::Matrix, AttributeError> {
let matrix = parse_transform_list(parser)?;
matrix
@@ -26,7 +26,7 @@ impl Parse for cairo::Matrix {
// Its operataion and grammar are described here:
// https://www.w3.org/TR/SVG/coords.html#TransformAttribute
-fn parse_transform_list(parser: &mut Parser) -> Result<cairo::Matrix, AttributeError> {
+fn parse_transform_list(parser: &mut Parser<'_, '_>) -> Result<cairo::Matrix, AttributeError> {
let mut matrix = cairo::Matrix::identity();
loop {
@@ -49,7 +49,7 @@ fn make_expected_function_error() -> AttributeError {
))
}
-fn parse_transform_command(parser: &mut Parser) -> Result<cairo::Matrix, AttributeError> {
+fn parse_transform_command(parser: &mut Parser<'_, '_>) -> Result<cairo::Matrix, AttributeError> {
match parser.next()?.clone() {
Token::Function(ref name) => parse_transform_function(name, parser),
@@ -64,7 +64,7 @@ fn parse_transform_command(parser: &mut Parser) -> Result<cairo::Matrix, Attribu
fn parse_transform_function(
name: &str,
- parser: &mut Parser,
+ parser: &mut Parser<'_, '_>,
) -> Result<cairo::Matrix, AttributeError> {
match name {
"matrix" => parse_matrix_args(parser),
@@ -77,7 +77,7 @@ fn parse_transform_function(
}
}
-fn parse_matrix_args(parser: &mut Parser) -> Result<cairo::Matrix, AttributeError> {
+fn parse_matrix_args(parser: &mut Parser<'_, '_>) -> Result<cairo::Matrix, AttributeError> {
parser
.parse_nested_block(|p| {
let xx = f64::from(p.expect_number()?);
@@ -102,13 +102,13 @@ fn parse_matrix_args(parser: &mut Parser) -> Result<cairo::Matrix, AttributeErro
.map_err(AttributeError::from)
}
-fn parse_translate_args(parser: &mut Parser) -> Result<cairo::Matrix, AttributeError> {
+fn parse_translate_args(parser: &mut Parser<'_, '_>) -> Result<cairo::Matrix, AttributeError> {
parser
.parse_nested_block(|p| {
let tx = f64::from(p.expect_number()?);
let ty = f64::from(
- p.try(|p| -> Result<f32, CssParseError<()>> {
+ p.try(|p| -> Result<f32, CssParseError<'_, ()>> {
optional_comma(p);
Ok(p.expect_number()?)
}).unwrap_or(0.0),
@@ -119,13 +119,13 @@ fn parse_translate_args(parser: &mut Parser) -> Result<cairo::Matrix, AttributeE
.map_err(AttributeError::from)
}
-fn parse_scale_args(parser: &mut Parser) -> Result<cairo::Matrix, AttributeError> {
+fn parse_scale_args(parser: &mut Parser<'_, '_>) -> Result<cairo::Matrix, AttributeError> {
parser
.parse_nested_block(|p| {
let x = f64::from(p.expect_number()?);
let y = p
- .try(|p| -> Result<f32, CssParseError<()>> {
+ .try(|p| -> Result<f32, CssParseError<'_, ()>> {
optional_comma(p);
Ok(p.expect_number()?)
}).map(f64::from)
@@ -136,14 +136,14 @@ fn parse_scale_args(parser: &mut Parser) -> Result<cairo::Matrix, AttributeError
.map_err(AttributeError::from)
}
-fn parse_rotate_args(parser: &mut Parser) -> Result<cairo::Matrix, AttributeError> {
+fn parse_rotate_args(parser: &mut Parser<'_, '_>) -> Result<cairo::Matrix, AttributeError> {
parser
.parse_nested_block(|p| {
let angle = f64::from(p.expect_number()?) * PI / 180.0;
let (s, c) = angle.sin_cos();
let (tx, ty) = p
- .try(|p| -> Result<_, CssParseError<()>> {
+ .try(|p| -> Result<_, CssParseError<'_, ()>> {
optional_comma(p);
let tx = f64::from(p.expect_number()?);
@@ -162,7 +162,7 @@ fn parse_rotate_args(parser: &mut Parser) -> Result<cairo::Matrix, AttributeErro
.map_err(AttributeError::from)
}
-fn parse_skewx_args(parser: &mut Parser) -> Result<cairo::Matrix, AttributeError> {
+fn parse_skewx_args(parser: &mut Parser<'_, '_>) -> Result<cairo::Matrix, AttributeError> {
parser
.parse_nested_block(|p| {
let a = f64::from(p.expect_number()?) * PI / 180.0;
@@ -171,7 +171,7 @@ fn parse_skewx_args(parser: &mut Parser) -> Result<cairo::Matrix, AttributeError
.map_err(AttributeError::from)
}
-fn parse_skewy_args(parser: &mut Parser) -> Result<cairo::Matrix, AttributeError> {
+fn parse_skewy_args(parser: &mut Parser<'_, '_>) -> Result<cairo::Matrix, AttributeError> {
parser
.parse_nested_block(|p| {
let a = f64::from(p.expect_number()?) * PI / 180.0;
diff --git a/rsvg_internals/src/unitinterval.rs b/rsvg_internals/src/unitinterval.rs
index b5e0d911..8c3de496 100644
--- a/rsvg_internals/src/unitinterval.rs
+++ b/rsvg_internals/src/unitinterval.rs
@@ -16,7 +16,7 @@ impl Parse for UnitInterval {
type Data = ();
type Err = AttributeError;
- fn parse(parser: &mut Parser, _: ()) -> Result<UnitInterval, AttributeError> {
+ fn parse(parser: &mut Parser<'_, '_>, _: ()) -> Result<UnitInterval, AttributeError> {
let x = f64::from(
parser
.expect_number()
diff --git a/rsvg_internals/src/viewbox.rs b/rsvg_internals/src/viewbox.rs
index 155a70e1..84ed7942 100644
--- a/rsvg_internals/src/viewbox.rs
+++ b/rsvg_internals/src/viewbox.rs
@@ -37,7 +37,7 @@ impl Parse for ViewBox {
// x, y, w, h
//
// Where w and h must be nonnegative.
- fn parse(parser: &mut Parser, _: ()) -> Result<ViewBox, AttributeError> {
+ fn parse(parser: &mut Parser<'_, '_>, _: ()) -> Result<ViewBox, AttributeError> {
let v = parsers::number_list(parser, ListLength::Exact(4))
.map_err(|_| ParseError::new("string does not match 'x [,] y [,] w [,] h'"))?;
diff --git a/rsvg_internals/src/viewport.rs b/rsvg_internals/src/viewport.rs
index 9d617eba..d19beae1 100644
--- a/rsvg_internals/src/viewport.rs
+++ b/rsvg_internals/src/viewport.rs
@@ -27,9 +27,9 @@ pub fn draw_in_viewport(
node: &RsvgNode,
values: &ComputedValues,
mut affine: cairo::Matrix,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
clipping: bool,
- draw_fn: &mut FnMut(&mut DrawingCtx) -> Result<(), RenderingError>,
+ draw_fn: &mut FnMut(&mut DrawingCtx<'_>) -> Result<(), RenderingError>,
) -> Result<(), RenderingError> {
// width or height set to 0 disables rendering of the element
// https://www.w3.org/TR/SVG/struct.html#SVGElementWidthAttribute
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]