Keep builder state when a property is None - #11
Conversation
Signed-off-by: Felicitas Pojtinger <felicitas@pojtinger.com>
There was a problem hiding this comment.
I'm not a glib expert but I think this looks good!
From a Rust perspective you could do an early return for value right at the beginning before you go into the match statement, something like that:
let Some(value) = value else {
return builder
};Now you can assume that value will always be Some for all code coming after.
Signed-off-by: Felicitas Pojtinger <felicitas@pojtinger.com>
|
@adzialocha Thanks for the review - I don't think I can do it before Is there a chance we could get this merged some time soon? The bug is still there on |
|
Thanks a ton for the merge :) Updating my bindings now! |
With the current state on
main, if you pass in a property asNone, the whole builder gets overwritten. This PR changes that so in the case where a property isNone, we just return the builder unchanged.This fixes connecting to a bootstrap node - with the state on
main, if you disable mDNS and connect via a bootstrap node, nothing ever connects otherwise since everyNoneargument would wipe all preceding arguments, e.g. the bootstrap URL.Heads up: My Rust is very rusty, so there might be a better way to do this I'm not aware of?