This commit is contained in:
evan-schott 2024-02-09 13:22:52 -08:00
parent 4164503f98
commit bfa41e1d79
6 changed files with 5 additions and 15 deletions

View File

@ -21,13 +21,10 @@ pub mod unroller;
pub use unroller::*;
pub mod unroll_expression;
pub use unroll_expression::*;
pub mod unroll_program;
pub use unroll_program::*;
pub mod unroll_statement;
pub use unroll_statement::*;
use crate::{Pass, SymbolTable, TypeTable};

View File

@ -48,7 +48,7 @@ impl<'a> ProgramVisitor<'a> for TypeChecker<'a> {
fn visit_stub(&mut self, input: &'a Stub) {
// Cannot have constant declarations in stubs.
if !input.consts.is_empty() {
self.emit_err(TypeCheckerError::stubs_cannot_have_const_declarations(input.consts.get(0).unwrap().1.span));
self.emit_err(TypeCheckerError::stubs_cannot_have_const_declarations(input.consts.first().unwrap().1.span));
}
// Typecheck the program's structs.

View File

@ -16,13 +16,9 @@
pub mod check_expressions;
pub use check_expressions::*;
pub mod check_program;
pub use check_program::*;
pub mod check_statements;
pub use check_statements::*;
pub mod checker;
pub use checker::*;

View File

@ -25,7 +25,6 @@ pub use self::formatted::*;
/// This module contains the macros for making errors easily.
#[macro_use]
pub mod macros;
pub use self::macros::*;
/// This module contains traits for making errors easily.
pub mod traits;

View File

@ -18,7 +18,6 @@ use super::*;
use snarkos_cli::commands::{Deploy as SnarkOSDeploy, Developer};
use snarkvm::cli::helpers::dotenv_private_key;
use std::path::PathBuf;
use tracing_subscriber::fmt::time;
/// Deploys an Aleo program.
#[derive(Parser, Debug)]

View File

@ -27,7 +27,7 @@ use retriever::LockFileEntry;
use std::{
env::current_dir,
fs::File,
io::{Read, Write},
io::Write,
path::{Path, PathBuf},
};
@ -121,7 +121,7 @@ impl Context {
}
let contents = std::fs::read_to_string(&lock_path)
.map_err(|err| PackageError::failed_to_read_file(&lock_path.to_str().unwrap(), err))?;
.map_err(|err| PackageError::failed_to_read_file(lock_path.to_str().unwrap(), err))?;
let entry_map: IndexMap<String, Vec<LockFileEntry>> =
toml::from_str(&contents).map_err(PackageError::failed_to_deserialize_lock_file)?;
@ -130,9 +130,8 @@ impl Context {
let list: Vec<(String, PathBuf)> = lock_entries
.iter()
.filter_map(|entry| match entry.path() {
Some(local_path) => Some((entry.name().to_string(), local_path.clone().join("build"))),
None => None,
.filter_map(|entry| {
entry.path().map(|local_path| (entry.name().to_string(), local_path.clone().join("build")))
})
.collect();