minor refactoring and fixes: dev module #373
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
4 commits, details as follows:
it doesn't make sense for a failed connection to panic in a function that's supposed to check for a connection, this fixes that (probably) unintended behavior.
https://rust-lang.github.io/rust-clippy/master/index.html#/assigning_clones
using
clone_from
let's us avoid unnecessary allocationsWe aren't in Go, we have better error handling available so should take advantage of it
TODO: There are more cases in this function where it may be better to propagate errors rather than panicing
https://rust-lang.github.io/rust-clippy/master/index.html#/never_loop
the loop only actually runs once, so an
if let
is a much more clear expression.