Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ident.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const MAX_LABEL_LENGTH: usize = 63;
#[derive(
Clone, Hash, PartialEq, Eq, PartialOrd, Ord, Debug, SerializeDisplay, DeserializeFromStr,
)]
pub struct Name(pub Vec<String>);
pub struct Name(Vec<String>);

impl Name {
/// Number of labels in the name (e.g., "vm1.test.mesh" has 3 labels).
Expand All @@ -38,7 +38,7 @@ impl Name {
#[must_use]
fn first_label(&self) -> &str {
// Labels are stored in reverse order, so the first label is last
self.0.last().expect("Name always has at least one label")
self.0.last().assert()
}

/// Check if this name starts with the given prefix.
Expand Down
Loading