[librsvg/librsvg-2.46] gradient: prefer or_else
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/librsvg-2.46] gradient: prefer or_else
- Date: Tue, 15 Oct 2019 16:45:20 +0000 (UTC)
commit 68710a25b11466a7ef87b130732fa76de1fd7066
Author: Paolo Borelli <pborelli gnome org>
Date: Sun Oct 13 12:22:15 2019 +0200
gradient: prefer or_else
rsvg_internals/src/gradient.rs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/rsvg_internals/src/gradient.rs b/rsvg_internals/src/gradient.rs
index 55cdaa2d..6b5a3540 100644
--- a/rsvg_internals/src/gradient.rs
+++ b/rsvg_internals/src/gradient.rs
@@ -488,9 +488,9 @@ impl UnresolvedGradient {
}
fn resolve_from_defaults(&self) -> UnresolvedGradient {
- let units = self.units.or(Some(GradientUnits::default()));
- let affine = self.affine.or(Some(cairo::Matrix::identity()));
- let spread = self.spread.or(Some(SpreadMethod::default()));
+ let units = self.units.or_else(|| Some(GradientUnits::default()));
+ let affine = self.affine.or_else(|| Some(cairo::Matrix::identity()));
+ let spread = self.spread.or_else(|| Some(SpreadMethod::default()));
let stops = self.stops.clone().or_else(|| Some(Vec::<ColorStop>::new()));
let variant = self.variant.resolve_from_defaults();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]