[librsvg: 2/51] Use ValueErrorKind::parse_error instead of creating the variant directly
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 2/51] Use ValueErrorKind::parse_error instead of creating the variant directly
- Date: Thu, 19 Dec 2019 01:48:10 +0000 (UTC)
commit 442c0ecb9467fe07c174ca11341683199fa73f9a
Author: Federico Mena Quintero <federico gnome org>
Date: Mon Dec 16 19:34:57 2019 -0600
Use ValueErrorKind::parse_error instead of creating the variant directly
rsvg_internals/src/parsers.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/rsvg_internals/src/parsers.rs b/rsvg_internals/src/parsers.rs
index a9367ce7..765afb4b 100644
--- a/rsvg_internals/src/parsers.rs
+++ b/rsvg_internals/src/parsers.rs
@@ -93,7 +93,7 @@ impl<T: Parse> ParseValue<T> for QualName {
impl Parse for f64 {
fn parse(parser: &mut Parser<'_, '_>) -> Result<f64, ValueErrorKind> {
Ok(f64::from(parser.expect_finite_number().map_err(|_| {
- ValueErrorKind::Parse(String::from("expected number"))
+ ValueErrorKind::parse_error("expected number")
})?))
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]