From a385a6d207bc8337029482474503d0e3fae2d44c Mon Sep 17 00:00:00 2001 From: Fuwn Date: Wed, 19 Jun 2024 06:46:20 +0000 Subject: deps(rustc): bump rust toolchain --- src/meta.rs | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'src/meta.rs') diff --git a/src/meta.rs b/src/meta.rs index 1991d3a..e9a80f1 100644 --- a/src/meta.rs +++ b/src/meta.rs @@ -16,7 +16,7 @@ // Copyright (C) 2022-2022 Fuwn // SPDX-License-Identifier: GPL-3.0-only -use std::{borrow::Cow, collections::HashMap}; +use std::{borrow::Cow, collections::HashMap, fmt::Display}; /// Structure-ize a Gemini response's meta section into it's mime type and it's /// parameters. @@ -28,20 +28,9 @@ pub struct Meta { parameters: HashMap, } -impl ToString for Meta { - /// Convert a `Meta` into a `String` - /// - /// # Example - /// ```rust - /// let original_string = "text/gemini; hi=2; hi2=string=2"; - /// - /// assert_eq!( - /// germ::meta::Meta::from_string(original_string).to_string(), - /// original_string - /// ); - /// ``` - fn to_string(&self) -> String { - format!("{}{}", self.mime, { +impl Display for Meta { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}{}", self.mime, { let mut parameters = self .parameters .iter() -- cgit v1.2.3