From cac544043ec46fe64ef64fe771ff9cf9715045cf Mon Sep 17 00:00:00 2001 From: yggverse Date: Sat, 18 Jan 2025 03:26:11 +0200 Subject: [PATCH] add `as_str` getter --- src/client/connection/response/meta/data.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/client/connection/response/meta/data.rs b/src/client/connection/response/meta/data.rs index 00ea4f5..3642847 100644 --- a/src/client/connection/response/meta/data.rs +++ b/src/client/connection/response/meta/data.rs @@ -54,6 +54,13 @@ impl Data { None => Err(Error::Protocol), } } + + // Getters + + /// Get `Self` as `std::str` + pub fn as_str(&self) -> &str { + self.0.as_str() + } } impl std::fmt::Display for Data {