(#503): Add "dyn SomeTrait" where rust 1.39 warns about it missing

parent 7cd081d4
Pipeline #111138 failed with stages
in 6 minutes and 14 seconds
......@@ -395,7 +395,7 @@ impl DrawingCtx {
node: &RsvgNode,
values: &ComputedValues,
clipping: bool,
draw_fn: &mut FnMut(&mut DrawingCtx) -> Result<(), RenderingError>,
draw_fn: &mut dyn FnMut(&mut DrawingCtx) -> Result<(), RenderingError>,
) -> Result<(), RenderingError> {
if clipping {
draw_fn(self)
......@@ -541,7 +541,7 @@ impl DrawingCtx {
/// was set by the `draw_fn`.
pub fn with_saved_matrix(
&mut self,
draw_fn: &mut FnMut(&mut DrawingCtx) -> Result<(), RenderingError>,
draw_fn: &mut dyn FnMut(&mut DrawingCtx) -> Result<(), RenderingError>,
) -> Result<(), RenderingError> {
let matrix = self.cr.get_matrix();
let res = draw_fn(self);
......@@ -552,7 +552,7 @@ impl DrawingCtx {
/// Saves the current Cairo context, runs the draw_fn, and restores the context
pub fn with_saved_cr(
&mut self,
draw_fn: &mut FnMut(&mut DrawingCtx) -> Result<(), RenderingError>,
draw_fn: &mut dyn FnMut(&mut DrawingCtx) -> Result<(), RenderingError>,
) -> Result<(), RenderingError> {
self.cr.save();
let res = draw_fn(self);
......
......@@ -39,7 +39,7 @@ impl Error for FilterError {
}
#[inline]
fn cause(&self) -> Option<&Error> {
fn cause(&self) -> Option<&dyn Error> {
None
}
}
......
......@@ -54,7 +54,7 @@ pub trait Filter: NodeTrait {
macro_rules! impl_node_as_filter {
() => (
fn as_filter(&self) -> Option<&Filter> {
fn as_filter(&self) -> Option<&dyn Filter> {
Some(self)
}
)
......
......@@ -34,7 +34,7 @@ pub struct NodeData {
values: ComputedValues,
cond: bool,
style_attr: String,
node_impl: Box<NodeTrait>,
node_impl: Box<dyn NodeTrait>,
}
impl NodeData {
......@@ -43,7 +43,7 @@ impl NodeData {
element_name: LocalName,
id: Option<&str>,
class: Option<&str>,
node_impl: Box<NodeTrait>,
node_impl: Box<dyn NodeTrait>,
) -> NodeData {
NodeData {
node_type,
......@@ -61,7 +61,7 @@ impl NodeData {
}
}
pub fn get_node_trait(&self) -> &NodeTrait {
pub fn get_node_trait(&self) -> &dyn NodeTrait {
self.node_impl.as_ref()
}
......@@ -363,7 +363,7 @@ pub trait NodeTrait: Downcast {
}
/// Returns the Filter trait if this node is a filter primitive
fn as_filter(&self) -> Option<&Filter> {
fn as_filter(&self) -> Option<&dyn Filter> {
None
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment