fix(dev): don't panic in is_connected if we couldn't get a connection to the db
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.
perf: assigning the result of Clone::clone() may be inefficient
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.