[librsvg] property_bag.rs: Remove unused lookup_and_parse()
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] property_bag.rs: Remove unused lookup_and_parse()
- Date: Thu, 16 Mar 2017 05:17:10 +0000 (UTC)
commit ef8fd91518f96f449aba4900104dd055ed0e968a
Author: Federico Mena Quintero <federico gnome org>
Date: Wed Mar 15 23:04:51 2017 -0600
property_bag.rs: Remove unused lookup_and_parse()
This is the one that didn't propagate errors.
Now, the only public function left that doesn't propagate errors is lookup().
rust/src/property_bag.rs | 17 -----------------
1 files changed, 0 insertions(+), 17 deletions(-)
---
diff --git a/rust/src/property_bag.rs b/rust/src/property_bag.rs
index d8801d8..60a16ad 100644
--- a/rust/src/property_bag.rs
+++ b/rust/src/property_bag.rs
@@ -27,23 +27,6 @@ pub fn lookup (pbag: *const RsvgPropertyBag, key: &str) -> Option<String> {
}
}
-pub fn lookup_and_parse<T: Default + FromStr> (pbag: *const RsvgPropertyBag, key: &str) -> T {
- let value = lookup (pbag, key);
-
- if let Some (v) = value {
- let result = T::from_str (&v);
-
- if let Ok (r) = result {
- r
- } else {
- // FIXME: Error is discarded here. Figure out a way to propagate it upstream.
- T::default ()
- }
- } else {
- T::default ()
- }
-}
-
pub fn length_or_default (pbag: *const RsvgPropertyBag, key: &'static str, length_dir: LengthDir) -> Result
<RsvgLength, NodeError> {
let value = lookup (pbag, key);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]