cargo fmt

This commit is contained in:
raychu86 2020-08-16 17:55:07 -07:00
parent 15d9b97067
commit 82bac674e9
3 changed files with 15 additions and 11 deletions

View File

@ -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::<Vec<u8>>())?;
}
}

View File

@ -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 {

View File

@ -265,7 +265,7 @@ impl From<leo_input::errors::InputParserError> for CLIError {
}
impl From<reqwest::Error> for CLIError {
fn from(error:reqwest::Error) -> Self {
fn from(error: reqwest::Error) -> Self {
log::error!("{}\n", error);
CLIError::Crate("rewquest", format!("{}", error))
}