diff --git a/leo/commands/add.rs b/leo/commands/add.rs index c2d789d7e7..bde16ce9a7 100644 --- a/leo/commands/add.rs +++ b/leo/commands/add.rs @@ -11,9 +11,18 @@ use crate::{ credentials::*, errors::{AddError::*, CLIError::AddError}, }; -use leo_package::{imports::{ImportsDirectory, IMPORTS_DIRECTORY_NAME}, root::Manifest}; +use leo_package::{ + imports::{ImportsDirectory, IMPORTS_DIRECTORY_NAME}, + root::Manifest, +}; -use std::{convert::TryFrom, collections::HashMap, env::current_dir, fs::{File, create_dir_all}, io::{Read, Write}}; +use std::{ + collections::HashMap, + convert::TryFrom, + env::current_dir, + fs::{create_dir_all, File}, + io::{Read, Write}, +}; pub const ADD_URL: &str = "api/package/fetch"; @@ -120,7 +129,6 @@ impl CLI for AddCommand { create_dir_all(parent_directory)?; } - File::create(file_path)?.write_all(&file.bytes().map(|e| e.unwrap()).collect::>())?; } } diff --git a/leo/commands/login.rs b/leo/commands/login.rs index 65099dc3eb..113b3a6d31 100644 --- a/leo/commands/login.rs +++ b/leo/commands/login.rs @@ -11,7 +11,7 @@ use crate::{ credentials::*, errors::{ CLIError::LoginError, - LoginError::{CannotGetToken, NoCredentialsProvided, NoConnectionFound, WrongLoginOrPassword}, + LoginError::{CannotGetToken, NoConnectionFound, NoCredentialsProvided, WrongLoginOrPassword}, }, }; @@ -57,9 +57,7 @@ impl CLI for LoginCommand { match arguments.value_of("NAME") { Some(name) => Ok((Some(name.to_string()), None, None)), - None => { - Ok((None, None, None)) - } + None => Ok((None, None, None)), } } @@ -103,9 +101,7 @@ impl CLI for LoginCommand { // Login using stored JWT credentials. // TODO (raychu86) Package manager re-authentication from token - (_, _, _) => { - Some(read_token()?) - } + (_, _, _) => Some(read_token()?), }; match token { diff --git a/leo/errors/cli.rs b/leo/errors/cli.rs index c2524fa7e1..1f3a1bb08e 100644 --- a/leo/errors/cli.rs +++ b/leo/errors/cli.rs @@ -265,7 +265,7 @@ impl From for CLIError { } impl From for CLIError { - fn from(error:reqwest::Error) -> Self { + fn from(error: reqwest::Error) -> Self { log::error!("{}\n", error); CLIError::Crate("rewquest", format!("{}", error)) }