Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Frizi committed Feb 1, 2023
1 parent 41a01f2 commit 7cc15d4
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion app/gui/language/span-tree/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ impl<T: Payload> SpanTree<T> {
/// span-tree. It will be used to print code fragments associated with each span.
///
/// Example output with AST ids removed for clarity:
/// ```
/// ```text
/// operator6.join operator31 Join_Kind.Inner ["County"] Root
/// operator6.join operator31 Join_Kind.Inner ["County"] ├── Chained
/// operator6.join operator31 Join_Kind.Inner ["County"] │ ├── Chained
Expand Down
3 changes: 3 additions & 0 deletions app/gui/language/span-tree/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ impl<T: Payload> Node<T> {
pub fn is_expected_argument(&self) -> bool {
self.kind.is_expected_argument()
}
pub fn is_function_parameter(&self) -> bool {
self.kind.is_function_parameter()
}
}


Expand Down
4 changes: 4 additions & 0 deletions app/gui/language/span-tree/src/node/kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ impl Kind {
/// or was skipped.
pub fn set_argument_info(&mut self, argument_info: ArgumentInfo) -> bool {
match self {
Self::Operation(t) => {
t.call_id = argument_info.call_id;
true
}
Self::This(t) => {
t.tp = argument_info.tp;
t.call_id = argument_info.call_id;
Expand Down
2 changes: 1 addition & 1 deletion app/gui/src/controller/graph/widgets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ impl WidgetVisualizationData {
/// of the response, the rest of the response is still processed, while errors are returned
/// separately for each failed widget.
fn try_deserialize(data: &VisualizationUpdateData) -> (Vec<WidgetUpdate>, Vec<failure::Error>) {
let arguments: Vec<(String, serde_json::Value)> = match serde_json::from_slice(&data) {
let arguments: Vec<(String, serde_json::Value)> = match serde_json::from_slice(data) {
Ok(args) => args,
Err(err) => {
let err = err
Expand Down
2 changes: 1 addition & 1 deletion app/gui/src/presenter/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ impl Graph {
view.set_expression_usage_type <+ update_expression.filter_map(f!((id) model.refresh_expression_type(*id)));
view.set_node_error_status <+ update_expression.filter_map(f!((id) model.refresh_node_error(*id)));

self.init_widgets(reset_node_types.into(), update_expression.clone_ref().into());
self.init_widgets(reset_node_types, update_expression.clone_ref());

// === Changes from the View ===

Expand Down
10 changes: 4 additions & 6 deletions app/gui/view/graph-editor/src/component/node/input/area.rs
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ impl Model {
widgets_map.insert(widget_bind, crumbs.clone_ref());
widget.set_x(position_x);
builder.parent.add_child(&widget);

if port.is_argument() {
let range = port.payload.range();
let code = &expression.viz_code[range];
Expand Down Expand Up @@ -586,11 +586,9 @@ impl Model {
// the same ast ID.
let prev_widgets_map = self.widgets_map.borrow();
let prev_id_crumbs_map = self.id_crumbs_map.borrow();
let prev_crumbs = prev_widgets_map.get(&widget_bind).or_else(|| {
port.ast_id.as_ref().and_then(|id| {
prev_id_crumbs_map.get(id)
})
});
let prev_crumbs = prev_widgets_map
.get(&widget_bind)
.or_else(|| port.ast_id.as_ref().and_then(|id| prev_id_crumbs_map.get(id)));
let prev_widget = prev_crumbs.and_then(|crumbs| {
let prev_expression = self.expression.borrow();
let prev_root = prev_expression.span_tree.root_ref();
Expand Down
4 changes: 2 additions & 2 deletions app/gui/view/graph-editor/src/component/node/input/widget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ impl Model {
*self.kind_model.borrow_mut() = desired_kind.map(|desired_kind| {
KindModel::new(&self.app, &self.display_object, desired_kind, frp, meta, node_data)
});
} else {
self.kind_model.borrow().as_ref().map(|model| model.update(meta, node_data));
} else if let Some(model) = self.kind_model.borrow().as_ref() {
model.update(meta, node_data);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/rust/prelude/src/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl Clone for TraceCopies {
let handle = self.handle.clone();
if let Some(name) = &*borrow {
let bt = backtrace();
debug!("[{name}] Cloning {self.clone_id} -> {clone_id} {bt}");
debug!("[{name}] Cloning {} -> {clone_id} {bt}", self.clone_id);
}
Self { clone_id, handle }
}
Expand Down

0 comments on commit 7cc15d4

Please sign in to comment.