From 3b9c1b1b1c8ee92b5d865158f975735f28e5c9ef Mon Sep 17 00:00:00 2001 From: yggverse Date: Tue, 3 Dec 2024 18:45:54 +0200 Subject: [PATCH] replace GString with String --- src/line/header.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/line/header.rs b/src/line/header.rs index 16c920e..1bf3e72 100644 --- a/src/line/header.rs +++ b/src/line/header.rs @@ -1,4 +1,4 @@ -use glib::{GString, Regex, RegexCompileFlags, RegexMatchFlags}; +use glib::{Regex, RegexCompileFlags, RegexMatchFlags}; /// [Header](https://geminiprotocol.net/docs/gemtext-specification.gmi#heading-lines) type holder pub enum Level { @@ -9,7 +9,7 @@ pub enum Level { /// [Header](https://geminiprotocol.net/docs/gemtext-specification.gmi#heading-lines) entity holder pub struct Header { - pub value: GString, + pub value: String, pub level: Level, } @@ -37,16 +37,13 @@ impl Header { }; // Detect header value - let value = regex.get(2)?; + let value = regex.get(2)?.to_string(); if value.trim().is_empty() { return None; } // Result - Some(Self { - level, - value: GString::from(value.as_str()), - }) + Some(Self { level, value }) } }