Skip to content

Commit

Permalink
Add doc example for default type parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
ClaasJG committed Apr 23, 2024
1 parent 2cefae1 commit 0fc0552
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion specs-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,17 @@ mod impl_saveload;
/// use specs::storage::VecStorage;
///
/// #[derive(Component, Debug)]
/// #[storage(VecStorage)] // This line is optional, defaults to `DenseVecStorage`
/// #[storage(VecStorage<Self>)] // This line is optional, defaults to `DenseVecStorage<Self>`
/// struct Pos(f32, f32, f32);
/// ```
///
/// When the type parameter is `<Self>` it can be omitted i.e.:
///
///```rust,ignore
/// use specs::storage::VecStorage;
///
/// #[derive(Component, Debug)]
/// #[storage(VecStorage)] // Equals to #[storage(VecStorage<Self>)]
/// struct Pos(f32, f32, f32);
/// ```
#[proc_macro_derive(Component, attributes(storage))]
Expand Down

0 comments on commit 0fc0552

Please sign in to comment.