Skip to content

Commit 898f675

Browse files
committed
[00246] Fix clippy type_complexity with ContextSnapshot type alias
1 parent 1b88b4a commit 898f675

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

rusty/src/views/view.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ impl Element {
114114
}
115115
}
116116

117+
/// A snapshot of a view's context map, cheaply clonable via `Arc`.
118+
pub type ContextSnapshot = HashMap<TypeId, Arc<dyn Any + Send + Sync>>;
119+
117120
/// A stateful component that produces an element tree.
118121
pub trait View: Send + Sync + 'static {
119122
/// Build the element tree for this view.
@@ -138,7 +141,7 @@ pub struct BuildContext<'a> {
138141
pub(crate) child_views: Vec<ChildViewEntry>,
139142
/// Cloned snapshots of ancestor context maps for safe context lookup.
140143
/// Each entry is a (ViewId, context map) pair, cheaply cloned via Arc.
141-
pub(crate) ancestor_contexts: Vec<(ViewId, HashMap<TypeId, Arc<dyn Any + Send + Sync>>)>,
144+
pub(crate) ancestor_contexts: Vec<(ViewId, ContextSnapshot)>,
142145
}
143146

144147
/// Cleanup function returned by an effect callback.

0 commit comments

Comments
 (0)