1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-12-01 09:13:54 +00:00

fix(clippy): fix new lint warning (#2803)

This commit is contained in:
David Knaack 2021-06-16 21:23:14 +02:00 committed by GitHub
parent e3421858cf
commit bddf5bf1d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -146,16 +146,14 @@ pub fn handle<'a>(module: &str, context: &'a Context) -> Option<Module<'a>> {
let elapsed = start.elapsed(); let elapsed = start.elapsed();
log::trace!("Took {:?} to compute module {:?}", elapsed, module); log::trace!("Took {:?} to compute module {:?}", elapsed, module);
if elapsed.as_millis() < 1 { if elapsed.as_millis() >= 1 {
// If we take less than 1ms to compute a None, then we will not return a module at all // If we take less than 1ms to compute a None, then we will not return a module at all
// if we have a module: default duration is 0 so no need to change it // if we have a module: default duration is 0 so no need to change it
m
} else {
// if we took more than 1ms we want to report that and so--in case we have None currently-- // if we took more than 1ms we want to report that and so--in case we have None currently--
// need to create an empty module just to hold the duration for that case // need to create an empty module just to hold the duration for that case
m.get_or_insert_with(|| context.new_module(module)).duration = elapsed; m.get_or_insert_with(|| context.new_module(module)).duration = elapsed;
m
} }
m
} }
pub fn description(module: &str) -> &'static str { pub fn description(module: &str) -> &'static str {