Clippy fixes and documentation
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-06-24 15:05:58 +02:00
parent 78bb91093b
commit 3400d9ec1e
12 changed files with 61 additions and 4 deletions

View File

@@ -5,6 +5,7 @@ use anyhow_ext::{ensure, Result};
use indexmap::IndexMap;
use parking_lot::RwLock;
use std::fmt::Debug;
use std::ops::Deref;
use std::sync::Arc;
/// A library of all natures that can be used, stored by their names.
@@ -64,7 +65,7 @@ impl NatureLibrary for NatureLibraryImpl {
for kv in read_lock.iter() {
// As natures can't be copied, and should always be the same reference as the value
// in the map, we just compare by reference.
if Arc::ptr_eq(&kv.1, nature) {
if kv.1.eq(nature.deref()) {
return Ok(kv.0.clone());
}
}