From 299ce5b35e62d8b8b3692f028c21bdfc82f49f62 Mon Sep 17 00:00:00 2001 From: danisaev Date: Mon, 13 Jul 2026 20:27:48 +0300 Subject: [PATCH] fix: Fixing errors in imports and error calls - Changed OutOfMemory to InvalidInput due to task - Changed std::io::ErrorKind to std::io --- src/system/database.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/system/database.rs b/src/system/database.rs index e434754..9505337 100644 --- a/src/system/database.rs +++ b/src/system/database.rs @@ -1,6 +1,5 @@ use std::collections::HashMap; use std::io; -use std::io::ErrorKind; use crate::{ChunkHash, MB}; @@ -78,7 +77,7 @@ impl Database for HashMap { } fn get(&self, key: &Hash) -> io::Result { - self.get(key).ok_or(ErrorKind::NotFound.into()).cloned() + self.get(key).ok_or(io::ErrorKind::NotFound.into()).cloned() } fn contains(&self, key: &Hash) -> bool { @@ -152,7 +151,7 @@ where fn insert(&mut self, key: K, value: V, value_size: usize) -> io::Result<()> { if self.size + value_size > self.max_size { let msg = "The container is too full for the desired data"; - return Err(io::Error::new(io::ErrorKind::OutOfMemory, msg)); + return Err(io::Error::new(io::ErrorKind::InvalidInput, msg)); } self.values.insert(key, value); @@ -165,7 +164,7 @@ where fn get(&self, key: &K) -> io::Result { self.values .get(key) - .ok_or(ErrorKind::NotFound.into()) + .ok_or(io::ErrorKind::NotFound.into()) .cloned() } }