We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b3caf66 commit aed5ed3Copy full SHA for aed5ed3
1 file changed
src/asset.rs
@@ -138,6 +138,9 @@ impl Asset {
138
///
139
/// An [`AssetRef`] is guaranteed to have been commissioned at some point, though it may
140
/// subsequently have been decommissioned.
141
+///
142
+/// [`AssetRef`]s must be created from `Rc<Asset>`s. If the asset has not been commissioned, this
143
+/// will panic.
144
#[derive(Clone, Debug)]
145
pub struct AssetRef(Rc<Asset>);
146
@@ -177,9 +180,7 @@ impl PartialEq for AssetRef {
177
180
impl Eq for AssetRef {}
178
181
179
182
impl Hash for AssetRef {
- /// Hash asset based purely on its ID.
- ///
- /// Panics if the asset has not been commissioned (and therefore has no ID).
183
+ /// Hash asset based purely on its ID
184
fn hash<H: Hasher>(&self, state: &mut H) {
185
self.0.id.unwrap().hash(state);
186
}
0 commit comments