Clean up imports and warnings in Rust code

This commit is contained in:
Keavon Chambers
2023-01-13 12:45:14 -08:00
parent b030a1860b
commit bf1a3e3daf
15 changed files with 204 additions and 191 deletions
@@ -62,23 +62,23 @@ fn start_widgets(document_node: &DocumentNode, node_id: NodeId, index: usize, na
widgets
}
fn text_widget(document_node: &DocumentNode, node_id: NodeId, index: usize, name: &str, blank_assist: bool) -> Vec<WidgetHolder> {
let mut widgets = start_widgets(document_node, node_id, index, name, FrontendGraphDataType::Text, blank_assist);
// fn text_widget(document_node: &DocumentNode, node_id: NodeId, index: usize, name: &str, blank_assist: bool) -> Vec<WidgetHolder> {
// let mut widgets = start_widgets(document_node, node_id, index, name, FrontendGraphDataType::Text, blank_assist);
if let NodeInput::Value {
tagged_value: TaggedValue::String(x),
exposed: false,
} = &document_node.inputs[index]
{
widgets.extend_from_slice(&[
WidgetHolder::unrelated_separator(),
TextInput::new(x.clone())
.on_update(update_value(|x: &TextInput| TaggedValue::String(x.value.clone()), node_id, index))
.widget_holder(),
])
}
widgets
}
// if let NodeInput::Value {
// tagged_value: TaggedValue::String(x),
// exposed: false,
// } = &document_node.inputs[index]
// {
// widgets.extend_from_slice(&[
// WidgetHolder::unrelated_separator(),
// TextInput::new(x.clone())
// .on_update(update_value(|x: &TextInput| TaggedValue::String(x.value.clone()), node_id, index))
// .widget_holder(),
// ])
// }
// widgets
// }
fn text_area_widget(document_node: &DocumentNode, node_id: NodeId, index: usize, name: &str, blank_assist: bool) -> Vec<WidgetHolder> {
let mut widgets = start_widgets(document_node, node_id, index, name, FrontendGraphDataType::Text, blank_assist);