diff --git a/crates/fj-core/src/objects/handles.rs b/crates/fj-core/src/objects/handles.rs index eb4085ebc..4db5a5cd0 100644 --- a/crates/fj-core/src/objects/handles.rs +++ b/crates/fj-core/src/objects/handles.rs @@ -80,6 +80,17 @@ impl Handles { item } + /// Return the first item + /// + /// # Panics + /// + /// Panics, if there are no items. + pub fn first(&self) -> &Handle { + self.inner + .first() + .expect("Requested first item, but no items available") + } + /// Return the n-th item pub fn nth(&self, index: usize) -> Option<&Handle> { self.inner.get(index)