Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
- Remove useless `vec![]`.
- Fix suspicious open options by adding truncate=true
  • Loading branch information
sveitser committed Apr 23, 2024
1 parent e57d845 commit dfa3a83
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion sequencer/src/bin/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,11 @@ async fn main() -> anyhow::Result<()> {
}

if let Some(out) = &opt.out {
let file = File::options().create(true).write(true).open(out)?;
let file = File::options()
.create(true)
.truncate(true)
.write(true)
.open(out)?;
contracts.write(file)?;
} else {
contracts.write(stdout())?;
Expand Down
6 changes: 5 additions & 1 deletion sequencer/src/bin/keygen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@ fn main() -> anyhow::Result<()> {
tracing::info!("generating new key set");

let path = opts.out.join(format!("{index}.env"));
let mut file = File::options().write(true).create(true).open(&path)?;
let mut file = File::options()
.write(true)
.create(true)
.truncate(true)
.open(&path)?;
opts.scheme.gen(seed, index as u64, &mut file)?;

tracing::info!("private keys written to {}", path.display());
Expand Down
2 changes: 1 addition & 1 deletion sequencer/src/block/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ mod test {

fn check_basic_correctness<TableWord: TableWordTraits>() {
// play with this
let test_cases = vec![
let test_cases = [
// 1 namespace only
vec![vec![5, 8, 8]], // 3 non-empty txs
vec![vec![0, 8, 8]], // 1 empty tx at the beginning
Expand Down

0 comments on commit dfa3a83

Please sign in to comment.