Skip to content

Commit 330903f

Browse files
committed
format type
1 parent d7b2134 commit 330903f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

editor/src/messages/portfolio/document/node_graph/node_properties.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,11 @@ pub(crate) fn property_from_type(
233233
"This data can only be supplied through the node graph because no widget exists for its type:\n\
234234
{}",
235235
// TODO: Avoid needing to remove spaces here by fixing how `alias` is generated
236-
concrete_type.alias.as_deref().map(|s| s.to_string().replace(" ", "")).unwrap_or(concrete_type.name.to_string())
236+
concrete_type
237+
.alias
238+
.as_deref()
239+
.map(|s| s.to_string().replace(" ", ""))
240+
.unwrap_or_else(|| graphene_std::format_type(concrete_type.name.as_ref()))
237241
))
238242
.widget_holder(),
239243
]);

node-graph/libraries/core-types/src/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ impl Type {
354354
}
355355
}
356356

357-
fn format_type(ty: &str) -> String {
357+
pub fn format_type(ty: &str) -> String {
358358
ty.split('<')
359359
.map(|path| path.split(',').map(|path| path.split("::").last().unwrap_or(path)).collect::<Vec<_>>().join(","))
360360
.collect::<Vec<_>>()

0 commit comments

Comments
 (0)