From 1f0103cbecc6a4dfe3f34fb6441d4d491b385142 Mon Sep 17 00:00:00 2001 From: cel 🌸 Date: Thu, 27 Jun 2024 20:22:16 +0100 Subject: WIP: stream parsing --- src/error.rs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/error.rs') diff --git a/src/error.rs b/src/error.rs index 12fcaf2..78508ae 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1 +1,19 @@ -pub enum Error {} +use std::str::Utf8Error; + +pub enum Error { + ReadError(std::io::Error), + Utf8Error(Utf8Error), + ParseError(String), +} + +impl From for Error { + fn from(e: std::io::Error) -> Self { + Self::ReadError(e) + } +} + +impl From for Error { + fn from(e: Utf8Error) -> Self { + Self::Utf8Error(e) + } +} -- cgit