tangled
alpha
login
or
join now
fuwn.net
/
germ
0
fork
atom
🦠 The Definitive Gemini Protocol Toolkit
gemini
gemini-protocol
gemtext
parser
zero-dependency
toolkit
ast
converter
html
markdown
cli
networking
0
fork
atom
overview
issues
pulls
pipelines
refactor: optimise more arguments
fuwn.net
2 years ago
3dbae42a
ce929f2d
verified
This commit was signed with the committer's
known signature
.
fuwn.net
SSH Key Fingerprint:
SHA256:VPdFPyPbd6JkoMyWUdZ/kkTcIAt3sxjXD2XSAZ7FYC4=
+7
-3
2 changed files
expand all
collapse all
unified
split
crates
germ
src
convert.rs
meta.rs
+5
-2
crates/germ/src/convert.rs
···
68
68
/// );
69
69
/// ```
70
70
#[must_use]
71
71
-
pub fn from_string(source: &str, target: &Target) -> String {
72
72
-
from_ast(&Ast::from_owned(&source), target)
71
71
+
pub fn from_string(
72
72
+
source: &(impl ToString + ?Sized),
73
73
+
target: &Target,
74
74
+
) -> String {
75
75
+
from_ast(&Ast::from_owned(&source.to_string()), target)
73
76
}
+2
-1
crates/germ/src/meta.rs
···
82
82
/// );
83
83
/// ```
84
84
#[must_use]
85
85
-
pub fn from_string(meta: &str) -> Self {
85
85
+
pub fn from_string(meta: impl Into<std::borrow::Cow<'static, str>>) -> Self {
86
86
+
let meta = meta.into().to_string();
86
87
let mut metas = meta.split(';');
87
88
let mime = metas.next().unwrap_or("").to_string();
88
89
let mut parameters = HashMap::new();