]> Repositorios git - scryer-prolog.git/commitdiff
fix compilation for 1.77
authorBennet Bleßmann <[email protected]>
Sat, 3 Aug 2024 18:04:16 +0000 (20:04 +0200)
committerBennet Bleßmann <[email protected]>
Mon, 5 Aug 2024 19:25:42 +0000 (21:25 +0200)
src/machine/preprocessor.rs

index b4effba33eb351f6220959f841f87f7180c8c21c..4c9c412e66452f06e4ea5b036e3ececea0ed7c64 100644 (file)
@@ -38,10 +38,11 @@ fn setup_op_decl(mut terms: Vec<Term>, atom_tbl: &AtomTable) -> Result<OpDecl, C
     let spec = to_op_decl_spec(spec)?;
 
     let prec = match terms.pop().unwrap() {
-        term @ Term::Literal(_, Literal::Fixnum(bi)) => match u16::try_from(bi.get_num()) {
+        // once msrv is >= 1.78 we can remove the ref and the clone of term below
+        ref term @ Term::Literal(_, Literal::Fixnum(bi)) => match u16::try_from(bi.get_num()) {
             Ok(n) if n <= 1200 => n,
             _ => {
-                return Err(CompilationError::InvalidOpDeclPrec(term));
+                return Err(CompilationError::InvalidOpDeclPrec(term.clone()));
             }
         },
         other => {