mirror of
https://github.com/YGGverse/ggemtext.git
synced 2026-03-31 09:05:32 +00:00
replace GString with String
This commit is contained in:
parent
155247a2ea
commit
3b9c1b1b1c
1 changed files with 4 additions and 7 deletions
|
|
@ -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 })
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue