]> Repositorios git - scryer-prolog.git/commitdiff
fmt
authorMark <[email protected]>
Fri, 2 Feb 2024 18:49:02 +0000 (11:49 -0700)
committerMark <[email protected]>
Fri, 2 Feb 2024 18:49:02 +0000 (11:49 -0700)
src/machine/streams.rs
src/machine/system_calls.rs
src/rcu.rs

index 53269bf49a62817ac884cc0713a43dee3aa680db..e05ad9837904104a89296d498ceeb3af7073fe11 100644 (file)
@@ -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;
index 5a10358d8882e75f6e51c8f19e28c94cb918113f..73bf62f226ec4ff5ae2ad9fe14c33c68605d2c51 100644 (file)
@@ -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<i64>>::try_into(&count).ok() {
+        if let Ok(value) = <&Integer as TryInto<i64>>::try_into(&count) {
             self.machine_st
                 .unify_fixnum(Fixnum::build_with(value), count_var);
         } else {
index 5c7c3201fba0822789ef2fef9d9225c7daae18c1..a3e8d2ab0ae11d8db13ed6a3f12e562ab09bff0e 100644 (file)
@@ -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<Arc<AtomicU8>> = OnceCell::new();
+    static THREAD_EPOCH_COUNTER: OnceCell<Arc<AtomicU8>> = const { OnceCell::new() };
 }
 
 pub struct Rcu<T> {