From: Mark Date: Fri, 2 Feb 2024 18:49:02 +0000 (-0700) Subject: fmt X-Git-Tag: v0.9.4~15 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=75a94fd0b359f9b9d1992207243ed1b4fb7bdc92;p=scryer-prolog.git fmt --- diff --git a/src/machine/streams.rs b/src/machine/streams.rs index 53269bf4..e05ad983 100644 --- a/src/machine/streams.rs +++ b/src/machine/streams.rs @@ -1875,7 +1875,7 @@ impl MachineState { }; if path.extension().is_none() { - if let Some(metadata) = file.metadata().ok() { + if let Ok(metadata) = file.metadata() { if metadata.is_dir() { path.set_extension("pl"); continue; diff --git a/src/machine/system_calls.rs b/src/machine/system_calls.rs index 5a10358d..73bf62f2 100644 --- a/src/machine/system_calls.rs +++ b/src/machine/system_calls.rs @@ -5629,7 +5629,7 @@ impl Machine { #[inline(always)] pub(crate) fn inference_count(&mut self, count_var: HeapCellValue, count: Integer) { - if let Some(value) = <&Integer as TryInto>::try_into(&count).ok() { + if let Ok(value) = <&Integer as TryInto>::try_into(&count) { self.machine_st .unify_fixnum(Fixnum::build_with(value), count_var); } else { diff --git a/src/rcu.rs b/src/rcu.rs index 5c7c3201..a3e8d2ab 100644 --- a/src/rcu.rs +++ b/src/rcu.rs @@ -22,7 +22,7 @@ thread_local! { // odd value means the current thread is about to access the active_epoch of an Rcu // a thread has a single epoch counter for all Rcu it accesses, // as a thread can only access one Rcu at a time - static THREAD_EPOCH_COUNTER: OnceCell> = OnceCell::new(); + static THREAD_EPOCH_COUNTER: OnceCell> = const { OnceCell::new() }; } pub struct Rcu {