Skip to content

Commit aed5ed3

Browse files
committed
Improve comments
1 parent b3caf66 commit aed5ed3

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/asset.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ impl Asset {
138138
///
139139
/// An [`AssetRef`] is guaranteed to have been commissioned at some point, though it may
140140
/// 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.
141144
#[derive(Clone, Debug)]
142145
pub struct AssetRef(Rc<Asset>);
143146

@@ -177,9 +180,7 @@ impl PartialEq for AssetRef {
177180
impl Eq for AssetRef {}
178181

179182
impl Hash for AssetRef {
180-
/// Hash asset based purely on its ID.
181-
///
182-
/// Panics if the asset has not been commissioned (and therefore has no ID).
183+
/// Hash asset based purely on its ID
183184
fn hash<H: Hasher>(&self, state: &mut H) {
184185
self.0.id.unwrap().hash(state);
185186
}

0 commit comments

Comments
 (0)