fix/suppress clippy warnings

This commit is contained in:
Dmitry Stepanov
2026-07-26 16:32:52 +03:00
parent 8363d35c0b
commit 0a41a5fe05
2 changed files with 13 additions and 4 deletions
+11 -4
View File
@@ -453,10 +453,17 @@ impl<F: EntityGetter> AddOrRemoveHashMapEntryCommand<F> {
let entity = some_or_return!((self.entity_getter)(ctx));
entity.resolve_path_mut(&self.path, &mut |result| match result {
Ok(entity) => match entity.as_hash_map_mut() {
Some(hash_map) => if let Ok(_) = hash_map.reflect_insert(
self.key.try_clone_box().expect("the key must be cloneable"),
self.value.take().unwrap(),
) {},
Some(hash_map) => {
if hash_map
.reflect_insert(
self.key.try_clone_box().expect("the key must be cloneable"),
self.value.take().unwrap(),
)
.is_err()
{
err!("cannot insert in the hash map")
}
}
None => {
err!("not a hash map")
}
+2
View File
@@ -18,6 +18,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#![allow(clippy::type_complexity)]
use crate::reflect::blank_reflect;
use crate::reflect::Reflect;
use std::collections::HashMap;