mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-06-01 09:42:41 +00:00
Remove errors details as they were quite useless
This commit is contained in:
parent
e8619a7df1
commit
c263b17651
13 changed files with 103 additions and 116 deletions
|
|
@ -1,11 +1,12 @@
|
|||
use crate::{GDResult, GDError};
|
||||
use crate::GDResult;
|
||||
use crate::GDError::{PacketOverflow, PacketUnderflow};
|
||||
|
||||
pub fn error_by_expected_size(expected: usize, size: usize) -> GDResult<()> {
|
||||
if size < expected {
|
||||
Err(GDError::PacketUnderflow("Unexpectedly short packet.".to_string()))
|
||||
Err(PacketUnderflow)
|
||||
}
|
||||
else if size > expected {
|
||||
Err(GDError::PacketOverflow("Unexpectedly long packet.".to_string()))
|
||||
Err(PacketOverflow)
|
||||
}
|
||||
else {
|
||||
Ok(())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue