bevy_utils: clippy without debug feature enabled (#19861)
# Objective - bevy_utils has warnings with clippy ## Solution - Fix them ## Testing `cargo clippy -p bevy_utils --no-deps -- -D warnings`
This commit is contained in:
parent
5f497efe90
commit
c077c65ddd
@ -7,7 +7,7 @@ use core::any::type_name;
|
|||||||
use disqualified::ShortName;
|
use disqualified::ShortName;
|
||||||
|
|
||||||
#[cfg(not(feature = "debug"))]
|
#[cfg(not(feature = "debug"))]
|
||||||
const FEATURE_DISABLED: &'static str = "Enable the debug feature to see the name";
|
const FEATURE_DISABLED: &str = "Enable the debug feature to see the name";
|
||||||
|
|
||||||
/// Wrapper to help debugging ECS issues. This is used to display the names of systems, components, ...
|
/// Wrapper to help debugging ECS issues. This is used to display the names of systems, components, ...
|
||||||
///
|
///
|
||||||
@ -36,7 +36,13 @@ impl DebugName {
|
|||||||
/// Create a new `DebugName` from a `&str`
|
/// Create a new `DebugName` from a `&str`
|
||||||
///
|
///
|
||||||
/// The value will be ignored if the `debug` feature is not enabled
|
/// The value will be ignored if the `debug` feature is not enabled
|
||||||
#[cfg_attr(not(feature = "debug"), expect(unused_variables))]
|
#[cfg_attr(
|
||||||
|
not(feature = "debug"),
|
||||||
|
expect(
|
||||||
|
unused_variables,
|
||||||
|
reason = "The value will be ignored if the `debug` feature is not enabled"
|
||||||
|
)
|
||||||
|
)]
|
||||||
pub fn borrowed(value: &'static str) -> Self {
|
pub fn borrowed(value: &'static str) -> Self {
|
||||||
DebugName {
|
DebugName {
|
||||||
#[cfg(feature = "debug")]
|
#[cfg(feature = "debug")]
|
||||||
@ -48,7 +54,13 @@ impl DebugName {
|
|||||||
/// Create a new `DebugName` from a `String`
|
/// Create a new `DebugName` from a `String`
|
||||||
///
|
///
|
||||||
/// The value will be ignored if the `debug` feature is not enabled
|
/// The value will be ignored if the `debug` feature is not enabled
|
||||||
#[cfg_attr(not(feature = "debug"), expect(unused_variables))]
|
#[cfg_attr(
|
||||||
|
not(feature = "debug"),
|
||||||
|
expect(
|
||||||
|
unused_variables,
|
||||||
|
reason = "The value will be ignored if the `debug` feature is not enabled"
|
||||||
|
)
|
||||||
|
)]
|
||||||
pub fn owned(value: String) -> Self {
|
pub fn owned(value: String) -> Self {
|
||||||
DebugName {
|
DebugName {
|
||||||
#[cfg(feature = "debug")]
|
#[cfg(feature = "debug")]
|
||||||
@ -88,7 +100,13 @@ impl DebugName {
|
|||||||
|
|
||||||
cfg::alloc! {
|
cfg::alloc! {
|
||||||
impl From<Cow<'static, str>> for DebugName {
|
impl From<Cow<'static, str>> for DebugName {
|
||||||
#[cfg_attr(not(feature = "debug"), expect(unused_variables))]
|
#[cfg_attr(
|
||||||
|
not(feature = "debug"),
|
||||||
|
expect(
|
||||||
|
unused_variables,
|
||||||
|
reason = "The value will be ignored if the `debug` feature is not enabled"
|
||||||
|
)
|
||||||
|
)]
|
||||||
fn from(value: Cow<'static, str>) -> Self {
|
fn from(value: Cow<'static, str>) -> Self {
|
||||||
Self {
|
Self {
|
||||||
#[cfg(feature = "debug")]
|
#[cfg(feature = "debug")]
|
||||||
|
Loading…
Reference in New Issue
Block a user