Fix clippy::unnecessary-literal-unwrap
in bevy_time
(#18485)
# Objective - Compiling `bevy_time` without the `std`-feature results in a `clippy::unnecessary-literal-unwrap`. ## Solution - Fix lint error ## Testing - CI ---
This commit is contained in:
parent
5ba86654a0
commit
d02a206940
@ -160,12 +160,13 @@ pub fn time_system(
|
||||
None => None,
|
||||
};
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
let sent_time = None;
|
||||
|
||||
match update_strategy.as_ref() {
|
||||
TimeUpdateStrategy::Automatic => {
|
||||
#[cfg(feature = "std")]
|
||||
real_time.update_with_instant(sent_time.unwrap_or_else(Instant::now));
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
real_time.update_with_instant(Instant::now());
|
||||
}
|
||||
TimeUpdateStrategy::ManualInstant(instant) => real_time.update_with_instant(*instant),
|
||||
TimeUpdateStrategy::ManualDuration(duration) => real_time.update_with_duration(*duration),
|
||||
|
Loading…
Reference in New Issue
Block a user