MCPcopy Create free account
hub / github.com/daisy/MathCAT / set_api_float_pref

Method set_api_float_pref

src/prefs.rs:876–882  ·  view source on GitHub ↗

Set the number-valued preference. All number-valued preferences are stored with type `f64`.

(&mut self, key: &str, value: f64)

Source from the content-addressed store, hash-verified

874 /// Set the number-valued preference.
875 /// All number-valued preferences are stored with type `f64`.
876 pub fn set_api_float_pref(&mut self, key: &str, value: f64) {
877 if !self.error.is_empty() {
878 panic!("Internal error: set_api_float_pref called on invalid PreferenceManager -- error message\n{}", &self.error);
879 };
880
881 self.api_prefs.prefs.insert(key.to_string(), Yaml::Real(value.to_string()));
882 }
883
884 pub fn set_api_boolean_pref(&mut self, key: &str, value: bool) {
885 if !self.error.is_empty() {

Callers 1

set_preferenceFunction · 0.80

Calls 1

is_emptyMethod · 0.80

Tested by

no test coverage detected