MCPcopy Create free account
hub / github.com/Recordscript/recordscript / get_double_string

Method get_double_string

libs/hbb_common/src/config.rs:1665–1677  ·  view source on GitHub ↗
(&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(

Callers 1

getMethod · 0.80

Calls 3

get_afterMethod · 0.80
parseMethod · 0.80
to_stringMethod · 0.80

Tested by

no test coverage detected