fix: pass &str instead of String in parse_gemtext

This commit is contained in:
Artemy Egorov 2024-08-04 11:10:43 +03:00
parent f45808fc40
commit 104968f95e
5 changed files with 6 additions and 9 deletions

View file

@ -1,5 +1,5 @@
use crate::typed::{
Body, Hl, NNBody,
Body, Hl,
Tag::{self, *},
};
@ -8,7 +8,7 @@ pub enum GemTextParseError {
InvalidLink,
}
pub fn parse_gemtext(s: String) -> Result<Vec<Tag>, GemTextParseError> {
pub fn parse_gemtext(s: &str) -> Result<Vec<Tag>, GemTextParseError> {
let mut page: Vec<Tag> = Vec::new();
let mut preformatted = false;
let mut preformatted_text: Vec<String> = Vec::new();