Skip to content

Commit d02a206

Browse files
authored
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 ---
1 parent 5ba8665 commit d02a206

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

crates/bevy_time/src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,13 @@ pub fn time_system(
160160
None => None,
161161
};
162162

163-
#[cfg(not(feature = "std"))]
164-
let sent_time = None;
165-
166163
match update_strategy.as_ref() {
167164
TimeUpdateStrategy::Automatic => {
165+
#[cfg(feature = "std")]
168166
real_time.update_with_instant(sent_time.unwrap_or_else(Instant::now));
167+
168+
#[cfg(not(feature = "std"))]
169+
real_time.update_with_instant(Instant::now());
169170
}
170171
TimeUpdateStrategy::ManualInstant(instant) => real_time.update_with_instant(*instant),
171172
TimeUpdateStrategy::ManualDuration(duration) => real_time.update_with_duration(*duration),

0 commit comments

Comments
 (0)