mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
Clarify the difference between default render layers and none
render layers (#14075)
# Objective It's not always obvious what the default value for `RenderLayers` represents. It is documented, but since it's an implementation of a trait method the documentation may or may not be shown depending on the IDE. ## Solution Add documentation to the `none` method that explicitly calls out the difference. --------- Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
This commit is contained in:
parent
f7bc0a01dd
commit
9055fc1d68
2 changed files with 6 additions and 2 deletions
|
@ -10,7 +10,7 @@ keywords = ["game", "engine", "gamedev", "graphics", "bevy"]
|
|||
license = "MIT OR Apache-2.0"
|
||||
repository = "https://github.com/bevyengine/bevy"
|
||||
documentation = "https://docs.rs/bevy"
|
||||
rust-version = "1.78.0"
|
||||
rust-version = "1.79.0"
|
||||
|
||||
[workspace]
|
||||
exclude = [
|
||||
|
|
|
@ -49,8 +49,10 @@ impl FromIterator<Layer> for RenderLayers {
|
|||
|
||||
impl Default for RenderLayers {
|
||||
/// By default, this structure includes layer `0`, which represents the first layer.
|
||||
///
|
||||
/// This is distinct from [`RenderLayers::none`], which doesn't belong to any layers.
|
||||
fn default() -> Self {
|
||||
Self::layer(0)
|
||||
const { Self::layer(0) }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,6 +70,8 @@ impl RenderLayers {
|
|||
}
|
||||
|
||||
/// Create a new `RenderLayers` that belongs to no layers.
|
||||
///
|
||||
/// This is distinct from [`RenderLayers::default`], which belongs to the first layer.
|
||||
pub const fn none() -> Self {
|
||||
RenderLayers(SmallVec::from_const([0; INLINE_BLOCKS]))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue