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:
Viktor Gustavsson 2025-03-22 14:27:37 +01:00 committed by GitHub
parent 5ba86654a0
commit d02a206940
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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),