cargo-clippy: Pass references to RsvgBbox, don't move the values

parent 444fd034
......@@ -7,6 +7,7 @@ use util::*;
/* Keep this in sync with ../../rsvg-private.h:RsvgBbox */
#[repr(C)]
#[derive(Copy, Clone)]
pub struct RsvgBbox {
pub rect: cairo::Rectangle,
pub affine: cairo::Matrix,
......
......@@ -684,7 +684,7 @@ pub extern fn rsvg_node_radial_gradient_new (_: *const libc::c_char, raw_parent:
fn resolve_fallbacks_and_set_pattern (gradient: &Gradient,
draw_ctx: *mut RsvgDrawingCtx,
opacity: u8,
bbox: RsvgBbox) -> bool {
bbox: &RsvgBbox) -> bool {
let mut fallback_source = NodeFallbackSource::new (draw_ctx);
if bbox.is_empty() {
......@@ -699,14 +699,14 @@ fn resolve_fallbacks_and_set_pattern (gradient: &Gradient,
pub fn gradient_resolve_fallbacks_and_set_pattern (node: &RsvgNode,
draw_ctx: *mut RsvgDrawingCtx,
opacity: u8,
bbox: RsvgBbox) -> bool {
bbox: &RsvgBbox) -> bool {
assert! (node.get_type () == NodeType::LinearGradient || node.get_type () == NodeType::RadialGradient);
let mut did_set_gradient = false;
node.with_impl (|node_gradient: &NodeGradient| {
let gradient = node_gradient.get_gradient_with_color_stops_from_node (node);
did_set_gradient = resolve_fallbacks_and_set_pattern (&gradient, draw_ctx, opacity, bbox);
did_set_gradient = resolve_fallbacks_and_set_pattern (&gradient, draw_ctx, opacity, &bbox);
});
did_set_gradient
......
......@@ -233,10 +233,10 @@ pub extern "C" fn _set_source_rsvg_paint_server(
node,
c_ctx,
opacity,
c_bbox,
&c_bbox,
);
} else if node.get_type() == NodeType::Pattern {
had_paint_server = pattern::pattern_resolve_fallbacks_and_set_pattern(node, c_ctx, c_bbox);
had_paint_server = pattern::pattern_resolve_fallbacks_and_set_pattern(node, c_ctx, &c_bbox);
}
}
......
......@@ -464,12 +464,12 @@ fn set_pattern_on_draw_context (pattern: &Pattern,
fn resolve_fallbacks_and_set_pattern (pattern: &Pattern,
draw_ctx: *mut RsvgDrawingCtx,
bbox: RsvgBbox) -> bool {
bbox: &RsvgBbox) -> bool {
let mut fallback_source = NodeFallbackSource::new (draw_ctx);
let resolved = resolve_pattern (pattern, &mut fallback_source);
set_pattern_on_draw_context (&resolved, draw_ctx, &bbox)
set_pattern_on_draw_context (&resolved, draw_ctx, bbox)
}
#[no_mangle]
......@@ -481,7 +481,7 @@ pub extern fn rsvg_node_pattern_new (_: *const libc::c_char, raw_parent: *const
pub fn pattern_resolve_fallbacks_and_set_pattern (node: &RsvgNode,
draw_ctx: *mut RsvgDrawingCtx,
bbox: RsvgBbox) -> bool {
bbox: &RsvgBbox) -> bool {
assert! (node.get_type () == NodeType::Pattern);
let mut did_set_pattern = false;
......
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