mirror of
https://github.com/a2x/cs2-dumper.git
synced 2026-04-17 16:39:58 +08:00
Refactor and move Linux code to separate branch
This commit is contained in:
20
src/error.rs
20
src/error.rs
@@ -5,23 +5,20 @@ pub enum Error {
|
||||
#[error(transparent)]
|
||||
Fmt(#[from] std::fmt::Error),
|
||||
|
||||
#[error("index {idx} is out of bounds for array with length {len}")]
|
||||
IndexOutOfBounds { idx: usize, len: usize },
|
||||
|
||||
#[error(transparent)]
|
||||
Io(#[from] std::io::Error),
|
||||
|
||||
#[error(transparent)]
|
||||
Memflow(#[from] memflow::error::Error),
|
||||
|
||||
#[error(transparent)]
|
||||
Pelite(#[from] pelite::Error),
|
||||
|
||||
#[error(transparent)]
|
||||
Serde(#[from] serde_json::Error),
|
||||
|
||||
#[error("unable to parse signature")]
|
||||
SignatureInvalid,
|
||||
|
||||
#[error("unable to find signature for: {0}")]
|
||||
SignatureNotFound(String),
|
||||
#[error("index {idx} is out of bounds for array with length {len}")]
|
||||
OutOfBounds { idx: usize, len: usize },
|
||||
|
||||
#[error("{0}")]
|
||||
Other(&'static str),
|
||||
@@ -34,11 +31,4 @@ impl<T> From<memflow::error::PartialError<T>> for Error {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<skidscan::SignatureParseError> for Error {
|
||||
#[inline]
|
||||
fn from(_err: skidscan::SignatureParseError) -> Self {
|
||||
Error::SignatureInvalid
|
||||
}
|
||||
}
|
||||
|
||||
pub type Result<T> = std::result::Result<T, Error>;
|
||||
|
||||
Reference in New Issue
Block a user