clean up compiler warnings in egui_node_graph2

This commit is contained in:
Skyler Lehmkuhl 2026-02-16 07:52:29 -05:00
parent da147fe6d4
commit 6c88c4a8da
3 changed files with 14 additions and 10 deletions

View File

@ -627,11 +627,11 @@ where
ui: &mut Ui,
user_state: &mut UserState,
) -> Vec<NodeResponse<UserResponse, NodeData>> {
let mut child_ui = ui.child_ui_with_id_source(
Rect::from_min_size(*self.position + self.pan, Self::MAX_NODE_SIZE.into()),
Layout::default(),
self.node_id,
None,
let mut child_ui = ui.new_child(
egui::UiBuilder::new()
.max_rect(Rect::from_min_size(*self.position + self.pan, Self::MAX_NODE_SIZE.into()))
.layout(Layout::default())
.id_salt(self.node_id),
);
Self::show_graph_node(self, pan_zoom, &mut child_ui, user_state)
@ -676,7 +676,11 @@ where
inner_rect.max.x = inner_rect.max.x.max(inner_rect.min.x);
inner_rect.max.y = inner_rect.max.y.max(inner_rect.min.y);
let mut child_ui = ui.child_ui(inner_rect, *ui.layout(), None);
let mut child_ui = ui.new_child(
egui::UiBuilder::new()
.max_rect(inner_rect)
.layout(*ui.layout()),
);
// Get interaction rect from memory, it may expand after the window response on resize.
let interaction_rect = ui

View File

@ -241,14 +241,14 @@ impl<NodeData> Node<NodeData> {
pub fn inputs<'a, DataType, DataValue>(
&'a self,
graph: &'a Graph<NodeData, DataType, DataValue>,
) -> impl Iterator<Item = &InputParam<DataType, DataValue>> + 'a {
) -> impl Iterator<Item = &'a InputParam<DataType, DataValue>> + 'a {
self.input_ids().map(|id| graph.get_input(id))
}
pub fn outputs<'a, DataType, DataValue>(
&'a self,
graph: &'a Graph<NodeData, DataType, DataValue>,
) -> impl Iterator<Item = &OutputParam<DataType>> + 'a {
) -> impl Iterator<Item = &'a OutputParam<DataType>> + 'a {
self.output_ids().map(|id| graph.get_output(id))
}

View File

@ -84,7 +84,7 @@ pub trait DataTypeTrait<UserState>: PartialEq + Eq {
/// }
/// }
/// ```
fn name(&self) -> std::borrow::Cow<str>;
fn name(&self) -> std::borrow::Cow<'_, str>;
}
/// This trait must be implemented for the `NodeData` generic parameter of the
@ -251,7 +251,7 @@ pub trait NodeTemplateTrait: Clone {
/// The return type is Cow<str> to allow returning owned or borrowed values
/// more flexibly. Refer to the documentation for `DataTypeTrait::name` for
/// more information
fn node_finder_label(&self, user_state: &mut Self::UserState) -> std::borrow::Cow<str>;
fn node_finder_label(&self, user_state: &mut Self::UserState) -> std::borrow::Cow<'_, str>;
/// Vec of categories to which the node belongs.
///