[librsvg: 4/43] handle: cleanup calls to map()
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 4/43] handle: cleanup calls to map()
- Date: Tue, 15 Oct 2019 00:05:49 +0000 (UTC)
commit dcbbf9c398c34e7cbff5cae9e7328ded2fafdf8e
Author: Paolo Borelli <pborelli gnome org>
Date: Sun Oct 13 12:14:45 2019 +0200
handle: cleanup calls to map()
rsvg_internals/src/handle.rs | 25 +++++--------------------
1 file changed, 5 insertions(+), 20 deletions(-)
---
diff --git a/rsvg_internals/src/handle.rs b/rsvg_internals/src/handle.rs
index 42bf513d..d38c04cd 100644
--- a/rsvg_internals/src/handle.rs
+++ b/rsvg_internals/src/handle.rs
@@ -294,14 +294,8 @@ impl Handle {
let bbox = draw_ctx.draw_node_from_stack(&CascadedValues::new_from_node(&root), &root, false)?;
- let ink_rect = bbox
- .ink_rect
- .map(|r| RsvgRectangle::from(r))
- .unwrap_or_default();
- let logical_rect = bbox
- .rect
- .map(|r| RsvgRectangle::from(r))
- .unwrap_or_default();
+ let ink_rect = bbox.ink_rect.map(RsvgRectangle::from).unwrap_or_default();
+ let logical_rect = bbox.rect.map(RsvgRectangle::from).unwrap_or_default();
Ok((ink_rect, logical_rect))
}
@@ -499,14 +493,8 @@ impl Handle {
let bbox = self.get_bbox_for_element(&node, dpi, is_testing)?;
- let mut ink_rect = bbox
- .ink_rect
- .map(|r| RsvgRectangle::from(r))
- .unwrap_or_default();
- let mut logical_rect = bbox
- .rect
- .map(|r| RsvgRectangle::from(r))
- .unwrap_or_default();
+ let mut ink_rect = bbox.ink_rect.map(RsvgRectangle::from).unwrap_or_default();
+ let mut logical_rect = bbox.rect.map(RsvgRectangle::from).unwrap_or_default();
// Translate so ink_rect is always at offset (0, 0)
@@ -541,10 +529,7 @@ impl Handle {
return Ok(());
}
- let ink_r = bbox
- .ink_rect
- .map(|r| RsvgRectangle::from(r))
- .unwrap_or_default();
+ let ink_r = bbox.ink_rect.map(RsvgRectangle::from).unwrap_or_default();
if ink_r.width == 0.0 || ink_r.height == 0.0 {
return Ok(());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]