]> Repositorios git - scryer-prolog.git/commitdiff
correct style failures
authorMark Thom <[email protected]>
Sat, 11 Nov 2023 17:41:46 +0000 (18:41 +0100)
committerMark Thom <[email protected]>
Sat, 11 Nov 2023 17:57:47 +0000 (18:57 +0100)
src/debray_allocator.rs
src/forms.rs
src/machine/loader.rs
src/parser/ast.rs

index 89ef44f3d9a348c0045635bef6a7edc192e6249a..30bb0a24b96d8289d6a3f4d353d982707809f87b 100644 (file)
@@ -166,32 +166,29 @@ impl DebrayAllocator {
         for var_num in subsumed_hits {
             match &mut self.var_data.records[var_num].allocation {
                 VarAlloc::Perm(_, ref mut allocation) => {
-                    match allocation {
-                        PermVarAllocation::Done {
-                            shallow_safety,
-                            deep_safety,
-                            ..
-                        } => {
-                            if !self
-                                .branch_stack
-                                .safety_unneeded_in_branch(shallow_safety, &branch_designator)
-                            {
-                                let branch_occurrences = self.branch_stack.last_mut().unwrap();
-                                branch_occurrences.shallow_safety.insert(var_num);
-                            }
-
-                            if !self
-                                .branch_stack
-                                .safety_unneeded_in_branch(deep_safety, &branch_designator)
-                            {
-                                let branch_occurrences = self.branch_stack.last_mut().unwrap();
-                                branch_occurrences.deep_safety.insert(var_num);
-                            }
+                   if let PermVarAllocation::Done {
+                        shallow_safety,
+                        deep_safety,
+                        ..
+                    } = allocation
+                   {
+                        if !self
+                            .branch_stack
+                            .safety_unneeded_in_branch(shallow_safety, &branch_designator)
+                        {
+                            let branch_occurrences = self.branch_stack.last_mut().unwrap();
+                            branch_occurrences.shallow_safety.insert(var_num);
                         }
-                        _ => {
+
+                        if !self
+                            .branch_stack
+                            .safety_unneeded_in_branch(deep_safety, &branch_designator)
+                        {
+                            let branch_occurrences = self.branch_stack.last_mut().unwrap();
+                            branch_occurrences.deep_safety.insert(var_num);
                         }
                     }
-
+                   
                     *allocation = PermVarAllocation::Pending;
                 }
                 _ => unreachable!(),
index 50a24b23c09a5af633eae2f39133d3da9cf6e2b6..d905571fc5d98e6b733dc7d67d0b5dd494510544 100644 (file)
@@ -876,7 +876,7 @@ impl ClauseIndexInfo {
     }
 }
 
-#[derive(Clone, Copy, Debug)]
+#[derive(Clone, Copy, Debug, Default)]
 pub(crate) struct PredicateInfo {
     pub(crate) is_extensible: bool,
     pub(crate) is_discontiguous: bool,
@@ -885,18 +885,7 @@ pub(crate) struct PredicateInfo {
     pub(crate) has_clauses: bool,
 }
 
-impl Default for PredicateInfo {
-    #[inline]
-    fn default() -> Self {
-        PredicateInfo {
-            is_extensible: false,
-            is_discontiguous: false,
-            is_dynamic: false,
-            is_multifile: false,
-            has_clauses: false,
-        }
-    }
-}
+
 
 impl PredicateInfo {
     #[inline]
index c795c973f923fa1f425fdf3543de2ad4f2997382..fb200f03b1fd3a1242df67b7a17e6a544c609c29 100644 (file)
@@ -148,9 +148,10 @@ impl<'a, LS: LoadState<'a>> Drop for Loader<'a, LS> {
     }
 }
 
-#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq)]
+#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, Default)]
 pub enum CompilationTarget {
     Module(Atom),
+    #[default]
     User,
 }
 
@@ -163,13 +164,6 @@ impl fmt::Display for CompilationTarget {
     }
 }
 
-impl Default for CompilationTarget {
-    #[inline]
-    fn default() -> Self {
-        CompilationTarget::User
-    }
-}
-
 impl CompilationTarget {
     #[inline]
     pub(crate) fn module_name(&self) -> Atom {
index 4859a65e9c386efcb6345bc06f2ffbecbe2c1c2e..ec46a74fc32c8702ba70b270743f83554fc4ef93 100644 (file)
@@ -327,8 +327,9 @@ impl DoubleQuotes {
     }
 }
 
-#[derive(Debug, Clone, Copy)]
+#[derive(Debug, Clone, Copy, Default)]
 pub enum Unknown {
+    #[default]
     Error,
     Fail,
     Warn,
@@ -348,13 +349,6 @@ impl Unknown {
     }
 }
 
-impl Default for Unknown {
-    #[inline]
-    fn default() -> Self {
-        Unknown::Error
-    }
-}
-
 pub fn default_op_dir() -> OpDir {
     let mut op_dir = OpDir::with_hasher(FxBuildHasher::default());