Open olson-dan opened 6 years ago
I noticed some code like this that I had written not long ago:
let meta = if let Some(meta) = data_store.get_meta(reference.key) { Some(meta) } else { None };
This can of course be simplified to
let meta = data_store.get_meta(reference.key);
There may be value in a clippy lint to catch cases like this, as it already warns on a lot of redundant code.
I vote to call this re-structuring. Destructuring only to construct the thing you just destructured.
I noticed some code like this that I had written not long ago:
This can of course be simplified to
There may be value in a clippy lint to catch cases like this, as it already warns on a lot of redundant code.