mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 14:42:40 +01:00
Implement is_some
for cln_rpc::options::Value
Can be used to check if a configuration is set
This commit is contained in:
parent
c404ebedcc
commit
a48e2258c7
1 changed files with 12 additions and 0 deletions
|
@ -63,6 +63,18 @@ impl Value {
|
|||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
/// Return `true` if the option is not None and `false` otherwise.
|
||||
pub fn is_some(&self) -> bool {
|
||||
match self {
|
||||
Value::String(_) => false,
|
||||
Value::Integer(_) => false,
|
||||
Value::Boolean(_) => false,
|
||||
Value::OptString => true,
|
||||
Value::OptInteger => true,
|
||||
Value::OptBoolean => true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// An stringly typed option that is passed to
|
||||
|
|
Loading…
Add table
Reference in a new issue