Method
get_double_string
(&self, key: &str, default: f64, min: f64, max: f64)
Source from the content-addressed store, hash-verified
| 1663 | |
| 1664 | #[inline] |
| 1665 | fn get_double_string(&self, key: &str, default: f64, min: f64, max: f64) -> String { |
| 1666 | match self.get_after(key) { |
| 1667 | Some(option) => { |
| 1668 | let v: f64 = option.parse().unwrap_or(default); |
| 1669 | if v >= min && v <= max { |
| 1670 | v.to_string() |
| 1671 | } else { |
| 1672 | default.to_string() |
| 1673 | } |
| 1674 | } |
| 1675 | None => default.to_string(), |
| 1676 | } |
| 1677 | } |
| 1678 | |
| 1679 | fn get_after(&self, k: &str) -> Option<String> { |
| 1680 | get_or( |
Tested by
no test coverage detected