Open simonsan opened 1 hour ago
I think that also addresses the removal of the blanket implementation for Option<T>
from https://github.com/rustic-rs/conflate/blob/c70b6a50a2f43ad9c1f59b056908559f21dc9122/src/lib.rs#L139 :
impl<T> Merge for Option<T> {
fn merge(&mut self, mut other: Self) {
if !self.is_some() {
*self = other.take();
}
}
}
In
::option
we have alreadyoverwrite_none
(Overwriteleft
withright
only ifleft
isNone
.) andrecurse
(If bothleft
andright
areSome
and implementMerge
, recursively merge the two.), but when merging values that don't implementMerge
(e.g.SocketAddress
) from a CLI into a default config, I feel I'm missingoverwrite_with_some
. Because in the default configuration, there might be already optional values set asSome(T)
, but the CLI values should still have higher precedence.