Added static fn type

This commit is contained in:
2026-06-06 23:52:53 +02:00
parent 330beaea75
commit 5e5d22f3c5
2 changed files with 9 additions and 5 deletions
+8 -5
View File
@@ -176,11 +176,6 @@ impl GetRust for Identifier {
impl GetRust for TypeExpr {
fn get_rust(&self) -> String {
match self {
// TypePostfix::Ref => format!("&"),
// TypePostfix::RefMut => format!("&mut "),
// TypePostfix::RefLifetime(lifetime) => format!("&'{} ", lifetime.get_rust()),
// TypePostfix::RefMutLifetime(lifetime) => format!("&'{} mut ", lifetime.get_rust()),
// TypePostfix::Dyn => format!("dyn "),
Self::Path(path, generics) => {
if let Some(generics) = generics {
format!("{}{}", get_static_type_path(path), generics.get_rust())
@@ -197,6 +192,14 @@ impl GetRust for TypeExpr {
.collect::<Vec<_>>()
.join(", ")
),
Self::StaticFn(types) => format!(
"fn({})",
types
.into_iter()
.map(|t| t.get_rust())
.collect::<Vec<_>>()
.join(", ")
),
Self::Ref {
lifetime,