[librsvg] pattern.rs: Implement FromStr for PatternContentUnits
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] pattern.rs: Implement FromStr for PatternContentUnits
- Date: Tue, 21 Mar 2017 22:58:13 +0000 (UTC)
commit c7d4ad44f1651c9d8f0c87c99ed0f5121a0e7371
Author: Federico Mena Quintero <federico gnome org>
Date: Tue Mar 21 16:53:29 2017 -0600
pattern.rs: Implement FromStr for PatternContentUnits
rust/src/pattern.rs | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/rust/src/pattern.rs b/rust/src/pattern.rs
index 7fa3653..3a82687 100644
--- a/rust/src/pattern.rs
+++ b/rust/src/pattern.rs
@@ -58,6 +58,14 @@ impl Default for PatternContentUnits {
}
}
+impl FromStr for PatternContentUnits {
+ type Err = AttributeError;
+
+ fn from_str (s: &str) -> Result<PatternContentUnits, AttributeError> {
+ Ok (PatternContentUnits::from (PaintServerUnits::from_str (s)?))
+ }
+}
+
extern "C" {
fn rsvg_pattern_node_to_rust_pattern (node: *const RsvgNode) -> *mut Pattern;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]