Skip to content

Commit

Permalink
add registry support for identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
JieningYu committed Jan 30, 2024
1 parent 1fed4ca commit a5c8733
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions util/identifier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ maintenance = { status = "passively-maintained" }
[dependencies]
serde = { version = "1.0", optional = true }
rimecraft-edcode = { path = "../edcode", optional = true }
rimecraft-registry = { path = "../registry", optional = true }

[features]
serde = ["dep:serde"]
edcode = ["dep:rimecraft-edcode"]
vanilla = []
vanilla-registry = ["vanilla", "dep:rimecraft-registry"]
8 changes: 8 additions & 0 deletions util/identifier/src/vanilla.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,3 +238,11 @@ mod tests {
assert_eq!(id, Identifier::new(Namespace::new("foo"), Path::new("bar")));
}
}

#[cfg(feature = "vanilla-registry")]
impl ::rimecraft_registry::key::Root for Identifier {
#[inline]
fn root() -> Self {
Self::new(Default::default(), Path::new("root"))
}
}

0 comments on commit a5c8733

Please sign in to comment.