diff options
| author | mat <github@matdoes.dev> | 2022-04-22 04:33:58 +0000 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-04-22 04:33:58 +0000 |
| commit | 248f752748a0033db7f8242ee0ecd73ea8ce8ec9 (patch) | |
| tree | 5412418d61b91d5b4174685cdb544a561e22eae6 /azalea-nbt/src/error.rs | |
| parent | 7cdd4171453ead8645b082f0cf5879f7d1a39660 (diff) | |
| download | azalea-drasl-248f752748a0033db7f8242ee0ecd73ea8ce8ec9.tar.xz | |
simplify error handling
Diffstat (limited to 'azalea-nbt/src/error.rs')
| -rwxr-xr-x[-rw-r--r--] | azalea-nbt/src/error.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/azalea-nbt/src/error.rs b/azalea-nbt/src/error.rs index 05ff15e0..278d2770 100644..100755 --- a/azalea-nbt/src/error.rs +++ b/azalea-nbt/src/error.rs @@ -14,3 +14,14 @@ impl std::fmt::Display for Error { } } } + +impl From<std::io::Error> for Error { + fn from(err: std::io::Error) -> Self { + Error::WriteError + } +} +impl From<std::string::FromUtf8Error> for Error { + fn from(err: std::string::FromUtf8Error) -> Self { + Error::WriteError + } +}
\ No newline at end of file |
