From 00a91d7c0cd34c5a76e58ca787ac87c7129f6059 Mon Sep 17 00:00:00 2001 From: yggverse Date: Wed, 23 Oct 2024 11:01:40 +0300 Subject: [PATCH] make status optional --- Cargo.toml | 2 +- src/client/response/header.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 265c506..e3f9df8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ggemini" -version = "0.1.1" +version = "0.1.2" edition = "2021" license = "MIT" readme = "README.md" diff --git a/src/client/response/header.rs b/src/client/response/header.rs index f0af429..ef3da60 100644 --- a/src/client/response/header.rs +++ b/src/client/response/header.rs @@ -9,7 +9,7 @@ pub use mime::Mime; pub use status::Status; pub struct Header { - status: Status, + status: Option, meta: Option, mime: Option, // @TODO @@ -38,15 +38,15 @@ impl Header { // let language = language::from_header(buffer); @TODO let status = match status::from_header(buffer) { - Ok(result) => result, - Err(_) => return Err(Error::Status), + Ok(result) => Some(result), + Err(_) => None, }; Ok(Self { status, meta, mime }) } // Getters - pub fn status(&self) -> &Status { + pub fn status(&self) -> &Option { &self.status }