[librsvg: 3/9] Add a Default implementation for BoundingBox
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 3/9] Add a Default implementation for BoundingBox
- Date: Sat, 1 Feb 2020 19:07:49 +0000 (UTC)
commit 495c083ace1ec43dc47bfc5bcfad0120d213e873
Author: Sven Neumann <sven svenfoo org>
Date: Thu Jan 30 08:41:54 2020 +0100
Add a Default implementation for BoundingBox
https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
rsvg_internals/src/bbox.rs | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/rsvg_internals/src/bbox.rs b/rsvg_internals/src/bbox.rs
index 39113a5b..7a8efaec 100644
--- a/rsvg_internals/src/bbox.rs
+++ b/rsvg_internals/src/bbox.rs
@@ -10,14 +10,20 @@ pub struct BoundingBox {
pub ink_rect: Option<Rect>, // with stroke
}
-impl BoundingBox {
- pub fn new() -> BoundingBox {
+impl Default for BoundingBox {
+ fn default() -> Self {
BoundingBox {
transform: Default::default(),
rect: None,
ink_rect: None,
}
}
+}
+
+impl BoundingBox {
+ pub fn new() -> BoundingBox {
+ Default::default()
+ }
pub fn with_transform(self, transform: Transform) -> BoundingBox {
BoundingBox { transform, ..self }
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]