Skip to content

Commit

Permalink
Merge pull request AleoNet#1776 from niklaslong/clippy
Browse files Browse the repository at this point in the history
Fix new clippy lints
  • Loading branch information
howardwu authored May 25, 2022
2 parents 13d080b + c62bba6 commit 4d7d67c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
5 changes: 4 additions & 1 deletion snarkos/display/aleo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ use snarkvm::dpc::prelude::*;

use colored::*;

use std::fmt::Write;

pub fn welcome_message() -> String {
let mut output = String::new();
output += &r#"
Expand Down Expand Up @@ -85,7 +87,8 @@ pub fn notification_message<N: Network>(miner: Option<Address<N>>) -> String {
.bold();

if let Some(miner) = miner {
output += &format!(
let _ = write!(
output,
"
Your Aleo miner address is {}
Expand Down
15 changes: 8 additions & 7 deletions snarkos/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use anyhow::{anyhow, Result};
use clap::Parser;
use colored::*;
use crossterm::tty::IsTty;
use std::{io, net::SocketAddr, path::PathBuf, str::FromStr};
use std::{fmt::Write, io, net::SocketAddr, path::PathBuf, str::FromStr};
use tokio::sync::mpsc;
use tracing_subscriber::EnvFilter;

Expand Down Expand Up @@ -193,7 +193,7 @@ impl Node {
// Initialize the display, if enabled.
if self.display {
println!("\nThe snarkOS console is initializing...\n");
let _display = Display::<N, E>::start(server.clone(), self.verbosity)?;
Display::<N, E>::start(server.clone(), self.verbosity)?;
};

// Connect to peer(s) if given as an argument.
Expand Down Expand Up @@ -408,13 +408,14 @@ impl NewAccount {

// Print the new Aleo account.
let mut output = "".to_string();
output += &format!(
write!(
output,
"\n {:>12}\n",
"Attention - Remember to store this account private key and view key.".red().bold()
);
output += &format!("\n {:>12} {}\n", "Private Key".cyan().bold(), account.private_key());
output += &format!(" {:>12} {}\n", "View Key".cyan().bold(), account.view_key());
output += &format!(" {:>12} {}\n", "Address".cyan().bold(), account.address());
)?;
writeln!(output, "\n {:>12} {}", "Private Key".cyan().bold(), account.private_key())?;
writeln!(output, " {:>12} {}", "View Key".cyan().bold(), account.view_key())?;
writeln!(output, " {:>12} {}", "Address".cyan().bold(), account.address())?;

Ok(output)
}
Expand Down
3 changes: 2 additions & 1 deletion snarkos/updater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

use colored::Colorize;
use self_update::{backends::github, version::bump_is_greater, Status};
use std::fmt::Write;

pub struct Updater;

Expand All @@ -34,7 +35,7 @@ impl Updater {

let mut output = "List of available versions\n".to_string();
for release in releases {
output += &format!(" * {}\n", release.version);
let _ = writeln!(output, " * {}", release.version);
}
Ok(output)
}
Expand Down

0 comments on commit 4d7d67c

Please sign in to comment.