[librsvg/librsvg-2.44] Explicitly add hidden lifetime parameters
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/librsvg-2.44] Explicitly add hidden lifetime parameters
- Date: Fri, 21 Sep 2018 17:40:37 +0000 (UTC)
commit 3a96b015cef112f0b88d4819dff3a7cee3188bb4
Author: Linus Unnebäck <linus folkdatorn se>
Date: Sun Sep 9 00:04:05 2018 +0200
Explicitly add hidden lifetime parameters
rsvg_internals/src/clip_path.rs | 4 +-
rsvg_internals/src/color.rs | 10 +++-
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 | 23 +++++----
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 | 15 ++++--
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 | 16 +++++--
rsvg_internals/src/gradient.rs | 21 +++++----
rsvg_internals/src/image.rs | 6 +--
rsvg_internals/src/iri.rs | 2 +-
rsvg_internals/src/length.rs | 11 +++--
rsvg_internals/src/link.rs | 10 ++--
rsvg_internals/src/load.rs | 4 +-
rsvg_internals/src/marker.rs | 17 ++++---
rsvg_internals/src/mask.rs | 4 +-
rsvg_internals/src/node.rs | 27 ++++++-----
rsvg_internals/src/paint_server.rs | 6 +--
rsvg_internals/src/parsers.rs | 17 ++++---
rsvg_internals/src/path_parser.rs | 2 +-
rsvg_internals/src/pattern.rs | 15 ++++--
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 | 9 ++--
rsvg_internals/src/stop.rs | 2 +-
rsvg_internals/src/structure.rs | 38 +++++++++------
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 +-
52 files changed, 299 insertions(+), 242 deletions(-)
---
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 a5623d53..c014f1e9 100644
--- a/rsvg_internals/src/color.rs
+++ b/rsvg_internals/src/color.rs
@@ -12,7 +12,10 @@ impl Parse for cssparser::Color {
type Data = ();
type Err = ValueErrorKind;
- fn parse(parser: &mut Parser, _: Self::Data) -> Result<cssparser::Color, ValueErrorKind> {
+ fn parse(
+ parser: &mut Parser<'_, '_>,
+ _: Self::Data,
+ ) -> Result<cssparser::Color, ValueErrorKind> {
cssparser::Color::parse(parser)
.map_err(|_| ValueErrorKind::Parse(ParseError::new("invalid syntax for color")))
}
@@ -22,7 +25,10 @@ impl Parse for cssparser::RGBA {
type Data = ();
type Err = ValueErrorKind;
- fn parse(parser: &mut Parser, _: Self::Data) -> Result<cssparser::RGBA, ValueErrorKind> {
+ fn parse(
+ parser: &mut Parser<'_, '_>,
+ _: Self::Data,
+ ) -> Result<cssparser::RGBA, ValueErrorKind> {
match cssparser::Color::parse(parser) {
Ok(cssparser::Color::RGBA(rgba)) => Ok(rgba),
Ok(cssparser::Color::CurrentColor) => Err(ValueErrorKind::Value(
diff --git a/rsvg_internals/src/coord_units.rs b/rsvg_internals/src/coord_units.rs
index 26528be9..2e4ed8ea 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 = ValueErrorKind;
- fn parse(parser: &mut Parser, _: ()) -> Result<CoordUnits, ValueErrorKind> {
+ fn parse(parser: &mut Parser<'_, '_>, _: ()) -> Result<CoordUnits, ValueErrorKind> {
let loc = parser.current_source_location();
parser
@@ -71,7 +71,7 @@ macro_rules! coord_units {
type Err = $crate::error::ValueErrorKind;
fn parse(
- parser: &mut ::cssparser::Parser,
+ parser: &mut ::cssparser::Parser<'_, '_>,
_: (),
) -> Result<Self, $crate::error::ValueErrorKind> {
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 298cf597..c34b2490 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,
@@ -341,7 +341,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)
@@ -750,7 +750,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,
@@ -781,7 +781,7 @@ impl<'a> DrawingCtx<'a> {
pub fn draw_node_from_stack(
&mut self,
- cascaded: &CascadedValues,
+ cascaded: &CascadedValues<'_>,
node: &RsvgNode,
clipping: bool,
) -> Result<(), RenderingError> {
@@ -1043,7 +1043,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) };
@@ -1067,7 +1067,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 };
@@ -1081,7 +1081,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());
@@ -1168,7 +1168,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 1fd56b23..0e3df141 100644
--- a/rsvg_internals/src/error.rs
+++ b/rsvg_internals/src/error.rs
@@ -54,7 +54,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 {
ValueErrorKind::Parse(ref n) => write!(
f,
@@ -80,7 +80,7 @@ impl From<ParseError> for ValueErrorKind {
}
impl<'a> From<BasicParseError<'a>> for ValueErrorKind {
- fn from(e: BasicParseError) -> ValueErrorKind {
+ fn from(e: BasicParseError<'_>) -> ValueErrorKind {
ValueErrorKind::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 0906fd16..d8586740 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 = ValueErrorKind;
- 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 6dd63fc1..5beb6a82 100644
--- a/rsvg_internals/src/filters/context.rs
+++ b/rsvg_internals/src/filters/context.rs
@@ -104,7 +104,7 @@ pub struct FilterContext {
fn compute_effects_region(
filter_node: &RsvgNode,
computed_from_target_node: &ComputedValues,
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
affine: cairo::Matrix,
width: f64,
height: f64,
@@ -195,7 +195,7 @@ impl FilterContext {
filter_node: &RsvgNode,
computed_from_node_being_filtered: &ComputedValues,
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();
@@ -294,7 +294,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,
@@ -325,7 +325,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
@@ -360,7 +360,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)?
@@ -422,7 +422,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,
@@ -437,7 +437,10 @@ impl FilterContext {
rv
} else {
f(Box::new(|length: &Length| {
- length.normalize(&self.computed_from_node_being_filtered, &draw_ctx.get_view_params())
+ length.normalize(
+ &self.computed_from_node_being_filtered,
+ &draw_ctx.get_view_params(),
+ )
}))
}
}
@@ -445,7 +448,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> {
@@ -484,7 +487,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() {
@@ -539,7 +542,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 2db20412..186fa397 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)?;
@@ -224,7 +224,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 f39f2235..6d7e103a 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> {
@@ -115,8 +115,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 = {
@@ -199,7 +199,7 @@ impl NodeTrait for Image {
&self,
node: &RsvgNode,
handle: *const RsvgHandle,
- pbag: &PropertyBag,
+ pbag: &PropertyBag<'_>,
) -> NodeResult {
self.base.set_atts(node, handle, pbag)?;
@@ -228,7 +228,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 7848a904..84068201 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,12 @@ 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 +194,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 +205,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 +234,7 @@ pub fn render(
filter_node: &RsvgNode,
computed_from_node_being_filtered: &ComputedValues,
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 c7bc2751..1612d681 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 5560edce..936937b6 100644
--- a/rsvg_internals/src/font_props.rs
+++ b/rsvg_internals/src/font_props.rs
@@ -76,7 +76,10 @@ impl Parse for FontSizeSpec {
type Data = ();
type Err = ValueErrorKind;
- fn parse(parser: &mut Parser, _: Self::Data) -> Result<FontSizeSpec, ::error::ValueErrorKind> {
+ fn parse(
+ parser: &mut Parser<'_, '_>,
+ _: Self::Data,
+ ) -> Result<FontSizeSpec, ::error::ValueErrorKind> {
let parser_state = parser.state();
Length::parse(parser, LengthDir::Both)
@@ -135,7 +138,7 @@ impl Parse for FontWeightSpec {
type Err = ValueErrorKind;
fn parse(
- parser: &mut Parser,
+ parser: &mut Parser<'_, '_>,
_: Self::Data,
) -> Result<FontWeightSpec, ::error::ValueErrorKind> {
if let Ok(r) = parser.try(|p| {
@@ -212,7 +215,7 @@ impl Parse for LetterSpacingSpec {
type Err = ValueErrorKind;
fn parse(
- parser: &mut Parser,
+ parser: &mut Parser<'_, '_>,
_: Self::Data,
) -> Result<LetterSpacingSpec, ::error::ValueErrorKind> {
let parser_state = parser.state();
@@ -250,14 +253,17 @@ impl Parse for SingleFontFamily {
type Data = ();
type Err = ValueErrorKind;
- fn parse(parser: &mut Parser, _: Self::Data) -> Result<SingleFontFamily, ValueErrorKind> {
+ fn parse(
+ parser: &mut Parser<'_, '_>,
+ _: Self::Data,
+ ) -> Result<SingleFontFamily, ValueErrorKind> {
parse_single_font_family(parser)
.map_err(|_| ValueErrorKind::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 b1d1e699..bf7bf9f4 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 = ValueErrorKind;
- fn parse(parser: &mut Parser, _: ()) -> Result<SpreadMethod, ValueErrorKind> {
+ fn parse(parser: &mut Parser<'_, '_>, _: ()) -> Result<SpreadMethod, ValueErrorKind> {
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> {
if let Some(acquired) = draw_ctx.get_acquired_node(name) {
let node_type = acquired.get().get_type();
@@ -427,7 +427,7 @@ fn acquire_gradient<'a>(draw_ctx: &'a mut DrawingCtx, name: &str) -> Option<Acqu
None
}
-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() {
@@ -455,7 +455,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,
@@ -532,7 +532,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,
) {
@@ -603,7 +603,12 @@ 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;
@@ -669,7 +674,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 {
@@ -687,7 +692,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 545bc9c9..b1c6bc01 100644
--- a/rsvg_internals/src/image.rs
+++ b/rsvg_internals/src/image.rs
@@ -47,7 +47,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
@@ -109,8 +109,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 3fe004a4..1d4257b8 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 = ValueErrorKind;
- fn parse(parser: &mut Parser, dir: LengthDir) -> Result<Length, ValueErrorKind> {
+ fn parse(parser: &mut Parser<'_, '_>, dir: LengthDir) -> Result<Length, ValueErrorKind> {
let length = Length::from_cssparser(parser, dir)?;
parser.expect_exhausted().map_err(|_| make_err())?;
@@ -137,7 +137,10 @@ impl Length {
}
}
- pub fn from_cssparser(parser: &mut Parser, dir: LengthDir) -> Result<Length, ValueErrorKind> {
+ pub fn from_cssparser(
+ parser: &mut Parser<'_, '_>,
+ dir: LengthDir,
+ ) -> Result<Length, ValueErrorKind> {
let length = {
let token = parser.next().map_err(|_| {
ValueErrorKind::Parse(ParseError::new(
@@ -273,7 +276,7 @@ impl Parse for Dasharray {
type Data = ();
type Err = ValueErrorKind;
- fn parse(parser: &mut Parser, _: Self::Data) -> Result<Dasharray, ValueErrorKind> {
+ fn parse(parser: &mut Parser<'_, '_>, _: Self::Data) -> Result<Dasharray, ValueErrorKind> {
if parser.try(|p| p.expect_ident_matching("none")).is_ok() {
Ok(Dasharray::None)
} else {
@@ -283,7 +286,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>, ValueErrorKind> {
+fn parse_dash_array(parser: &mut Parser<'_, '_>) -> Result<Vec<Length>, ValueErrorKind> {
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 b715444a..53142970 100644
--- a/rsvg_internals/src/load.rs
+++ b/rsvg_internals/src/load.rs
@@ -275,7 +275,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,
) -> *const RsvgNode {
assert!(!raw_name.is_null());
@@ -324,7 +324,7 @@ pub extern "C" fn rsvg_load_new_node(
pub extern "C" fn rsvg_load_set_node_atts(
handle: *const RsvgHandle,
raw_node: *mut RsvgNode,
- 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 9027f69f..40adc887 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 = ValueErrorKind;
- fn parse(parser: &mut Parser, _: ()) -> Result<MarkerUnits, ValueErrorKind> {
+ fn parse(parser: &mut Parser<'_, '_>, _: ()) -> Result<MarkerUnits, ValueErrorKind> {
let loc = parser.current_source_location();
parser
@@ -76,7 +76,7 @@ impl Parse for MarkerOrient {
type Data = ();
type Err = ValueErrorKind;
- fn parse(parser: &mut Parser, _: ()) -> Result<MarkerOrient, ValueErrorKind> {
+ fn parse(parser: &mut Parser<'_, '_>, _: ()) -> Result<MarkerOrient, ValueErrorKind> {
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,
@@ -207,7 +207,12 @@ 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();
@@ -627,7 +632,7 @@ enum MarkerType {
}
fn emit_marker_by_name(
- draw_ctx: &mut DrawingCtx,
+ draw_ctx: &mut DrawingCtx<'_>,
name: &str,
xpos: f64,
ypos: f64,
@@ -684,7 +689,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 af783869..f0c2c810 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
@@ -292,7 +292,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)
}
@@ -346,7 +346,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, ()) {
@@ -378,7 +378,10 @@ 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() {
@@ -544,8 +547,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() {
@@ -601,8 +604,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() {
@@ -856,7 +859,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 e43a1b4d..7e8f25a6 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 = ValueErrorKind;
- fn parse(parser: &mut Parser, _: ()) -> Result<PaintServer, ValueErrorKind> {
+ fn parse(parser: &mut Parser<'_, '_>, _: ()) -> Result<PaintServer, ValueErrorKind> {
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 d7fcb407..03efd310 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 = ValueErrorKind;
- fn parse(parser: &mut Parser, _: ()) -> Result<f64, ValueErrorKind> {
+ fn parse(parser: &mut Parser<'_, '_>, _: ()) -> Result<f64, ValueErrorKind> {
Ok(f64::from(parser.expect_number().map_err(|_| {
ValueErrorKind::Parse(ParseError::new("expected number"))
})?))
@@ -61,7 +61,7 @@ impl Parse for String {
type Data = ();
type Err = ValueErrorKind;
- fn parse(parser: &mut Parser, _: ()) -> Result<String, ValueErrorKind> {
+ fn parse(parser: &mut Parser<'_, '_>, _: ()) -> Result<String, ValueErrorKind> {
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,10 @@ 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 7a325603..46104c1d 100644
--- a/rsvg_internals/src/pattern.rs
+++ b/rsvg_internals/src/pattern.rs
@@ -170,7 +170,12 @@ 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 +234,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();
let mut stack = NodeStack::new();
@@ -260,7 +265,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());
@@ -442,7 +447,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);
@@ -452,7 +457,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 31b0b70c..2335e3c9 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::ValueErrorKind;
- fn parse(parser: &mut ::cssparser::Parser, _: Self::Data) -> Result<$name,
::error::ValueErrorKind> {
+ fn parse(parser: &mut ::cssparser::Parser<'_, '_>, _: Self::Data) -> Result<$name,
::error::ValueErrorKind> {
let loc = parser.current_source_location();
parser
@@ -97,7 +97,7 @@ macro_rules! make_property {
type Data = $parse_data_type;
type Err = ::error::ValueErrorKind;
- fn parse(parser: &mut ::cssparser::Parser, d: Self::Data) -> Result<$name,
::error::ValueErrorKind> {
+ fn parse(parser: &mut ::cssparser::Parser<'_, '_>, d: Self::Data) -> Result<$name,
::error::ValueErrorKind> {
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::ValueErrorKind;
- fn parse(parser: &mut ::cssparser::Parser, d: Self::Data) -> Result<$name,
::error::ValueErrorKind> {
+ fn parse(parser: &mut ::cssparser::Parser<'_, '_>, d: Self::Data) -> Result<$name,
::error::ValueErrorKind> {
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 82da4848..ef1cf3da 100644
--- a/rsvg_internals/src/state.rs
+++ b/rsvg_internals/src/state.rs
@@ -539,7 +539,10 @@ 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 +665,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::ValueErrorKind> {
+ fn parse(parser: &mut Parser<'_, '_>, _: Self::Data) -> Result<BaselineShift,
::error::ValueErrorKind> {
let parser_state = parser.state();
{
@@ -1225,7 +1228,7 @@ make_property!(
type Data = ();
type Err = ValueErrorKind;
- fn parse(parser: &mut Parser, _: Self::Data) -> Result<TextDecoration, ValueErrorKind> {
+ fn parse(parser: &mut Parser<'_, '_>, _: Self::Data) -> Result<TextDecoration, ValueErrorKind> {
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 1d9b52f4..7b6d0e60 100644
--- a/rsvg_internals/src/stop.rs
+++ b/rsvg_internals/src/stop.rs
@@ -45,7 +45,7 @@ fn validate_offset(length: Length) -> Result<Length, ValueErrorKind> {
}
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 e5d5eb3d..90e435ed 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,12 @@ 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 +188,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 +246,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 +281,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();
@@ -390,7 +395,12 @@ 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 fe46d0ad..3563c85d 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 8871fa54..01c572a6 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 = ValueErrorKind;
- fn parse(parser: &mut Parser, _: ()) -> Result<cairo::Matrix, ValueErrorKind> {
+ fn parse(parser: &mut Parser<'_, '_>, _: ()) -> Result<cairo::Matrix, ValueErrorKind> {
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, ValueErrorKind> {
+fn parse_transform_list(parser: &mut Parser<'_, '_>) -> Result<cairo::Matrix, ValueErrorKind> {
let mut matrix = cairo::Matrix::identity();
loop {
@@ -49,7 +49,7 @@ fn make_expected_function_error() -> ValueErrorKind {
))
}
-fn parse_transform_command(parser: &mut Parser) -> Result<cairo::Matrix, ValueErrorKind> {
+fn parse_transform_command(parser: &mut Parser<'_, '_>) -> Result<cairo::Matrix, ValueErrorKind> {
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, ValueEr
fn parse_transform_function(
name: &str,
- parser: &mut Parser,
+ parser: &mut Parser<'_, '_>,
) -> Result<cairo::Matrix, ValueErrorKind> {
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, ValueErrorKind> {
+fn parse_matrix_args(parser: &mut Parser<'_, '_>) -> Result<cairo::Matrix, ValueErrorKind> {
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, ValueErrorKin
.map_err(ValueErrorKind::from)
}
-fn parse_translate_args(parser: &mut Parser) -> Result<cairo::Matrix, ValueErrorKind> {
+fn parse_translate_args(parser: &mut Parser<'_, '_>) -> Result<cairo::Matrix, ValueErrorKind> {
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, ValueError
.map_err(ValueErrorKind::from)
}
-fn parse_scale_args(parser: &mut Parser) -> Result<cairo::Matrix, ValueErrorKind> {
+fn parse_scale_args(parser: &mut Parser<'_, '_>) -> Result<cairo::Matrix, ValueErrorKind> {
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, ValueErrorKind
.map_err(ValueErrorKind::from)
}
-fn parse_rotate_args(parser: &mut Parser) -> Result<cairo::Matrix, ValueErrorKind> {
+fn parse_rotate_args(parser: &mut Parser<'_, '_>) -> Result<cairo::Matrix, ValueErrorKind> {
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, ValueErrorKin
.map_err(ValueErrorKind::from)
}
-fn parse_skewx_args(parser: &mut Parser) -> Result<cairo::Matrix, ValueErrorKind> {
+fn parse_skewx_args(parser: &mut Parser<'_, '_>) -> Result<cairo::Matrix, ValueErrorKind> {
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, ValueErrorKind
.map_err(ValueErrorKind::from)
}
-fn parse_skewy_args(parser: &mut Parser) -> Result<cairo::Matrix, ValueErrorKind> {
+fn parse_skewy_args(parser: &mut Parser<'_, '_>) -> Result<cairo::Matrix, ValueErrorKind> {
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 5587a74b..a0ff916d 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 = ValueErrorKind;
- fn parse(parser: &mut Parser, _: ()) -> Result<UnitInterval, ValueErrorKind> {
+ fn parse(parser: &mut Parser<'_, '_>, _: ()) -> Result<UnitInterval, ValueErrorKind> {
let x = f64::from(
parser
.expect_number()
diff --git a/rsvg_internals/src/viewbox.rs b/rsvg_internals/src/viewbox.rs
index 938188a0..cc7d7bc3 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, ValueErrorKind> {
+ fn parse(parser: &mut Parser<'_, '_>, _: ()) -> Result<ViewBox, ValueErrorKind> {
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]