diff options
| author | Leedehai <18319900+Leedehai@users.noreply.github.com> | 2023-05-19 08:54:44 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-19 14:54:44 +0200 |
| commit | 84b9d9c9906a2f39718b6b19e40c9f5f200d7f96 (patch) | |
| tree | 754a9c4ac34162bed085478e1984b3311c688ccd /library/src | |
| parent | e32c6f8e8acc2b26fc41cb8f62c5aba7e248db59 (diff) | |
Print the string that is not castable to number (#1207)
Diffstat (limited to 'library/src')
| -rw-r--r-- | library/src/compute/construct.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/src/compute/construct.rs b/library/src/compute/construct.rs index d39b69dd..74e96b5d 100644 --- a/library/src/compute/construct.rs +++ b/library/src/compute/construct.rs @@ -38,7 +38,7 @@ cast_from_value! { v: bool => Self(v as i64), v: i64 => Self(v), v: f64 => Self(v as i64), - v: EcoString => Self(v.parse().map_err(|_| "not a valid integer")?), + v: EcoString => Self(v.parse().map_err(|_| eco_format!("invalid integer: {}", v))?), } /// Convert a value to a float. @@ -79,7 +79,7 @@ cast_from_value! { v: i64 => Self(v as f64), v: f64 => Self(v), v: Ratio => Self(v.get()), - v: EcoString => Self(v.parse().map_err(|_| "not a valid float")?), + v: EcoString => Self(v.parse().map_err(|_| eco_format!("invalid float: {}", v))?), } /// Create a grayscale color. |
