mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
Add Params::set_cmd and use SystemMessage constants
This commit is contained in:
committed by
Floris Bruynooghe
parent
dced1932b3
commit
cfa69cf35a
@@ -189,6 +189,11 @@ impl Params {
|
||||
.unwrap_or_default()
|
||||
}
|
||||
|
||||
/// Set the parameter behind `Param::Cmd`.
|
||||
pub fn set_cmd(&mut self, value: SystemMessage) {
|
||||
self.set_int(Param::Cmd, value as i32);
|
||||
}
|
||||
|
||||
/// Get the given parameter and parse as `f64`.
|
||||
pub fn get_float(&self, key: Param) -> Option<f64> {
|
||||
self.get(key).and_then(|s| s.parse().ok())
|
||||
|
||||
Reference in New Issue
Block a user