From b073670732db158a7d34f84c8979f2c38c563a38 Mon Sep 17 00:00:00 2001 From: EliasSchriefer Date: Fri, 17 Sep 2021 19:00:38 +0200 Subject: [PATCH] Rename MaybeIncompleteDataError ...to BufferOverflowError --- src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index ac3faff..e67f07c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -53,11 +53,11 @@ fn gen_session_id() -> u32 { /// The response may be incomplete, if the buffer has been filled up, /// because excess bytes that don't fit into it are discarded. #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] -pub struct MaybeIncompleteDataError(usize); +pub struct BufferOverflowError(usize); -impl Error for MaybeIncompleteDataError {} +impl Error for BufferOverflowError {} -impl Display for MaybeIncompleteDataError { +impl Display for BufferOverflowError { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { write!(f, "Buffer filled up") } @@ -175,7 +175,7 @@ impl BasicQueryRequest { // Receiving let bytes_read = tokioTimeout(timeout, socket.recv(buffer)).await??; if bytes_read == buffer.len() { - return Err(io::Error::new(ErrorKind::Other, MaybeIncompleteDataError(bytes_read))); + return Err(io::Error::new(ErrorKind::Other, BufferOverflowError(bytes_read))); } // Parsing @@ -302,7 +302,7 @@ impl FullQueryRequest { // Receiving let bytes_read = tokioTimeout(timeout, socket.recv(buffer)).await??; if bytes_read == buffer.len() { - return Err(io::Error::new(ErrorKind::Other, MaybeIncompleteDataError(bytes_read))); + return Err(io::Error::new(ErrorKind::Other, BufferOverflowError(bytes_read))); } // Parsing