Fixes error on propagating a Result<()> with the ? operator
This commit is contained in:
committed by
Jakob Stoklund Olesen
parent
9f00a40b52
commit
0bc27fca9a
@@ -117,7 +117,9 @@ impl Configurable for Builder {
|
||||
let (offset, detail) = self.lookup(name)?;
|
||||
match detail {
|
||||
Detail::Bool { bit } => {
|
||||
self.set_bit(offset, bit, parse_bool_value(value))?;
|
||||
// Cannot currently propagate Result<()> up on functions returning ()
|
||||
// with the `?` operator
|
||||
self.set_bit(offset, bit, parse_bool_value(value)?);
|
||||
}
|
||||
Detail::Num => {
|
||||
self.bytes[offset] = value.parse().map_err(|_| Error::BadValue)?;
|
||||
|
||||
Reference in New Issue
Block a user