Formatting

This commit is contained in:
Antoine Gersant 2016-09-17 00:39:40 -07:00
parent c79efa1abc
commit 878bb3b180
3 changed files with 4 additions and 6 deletions

View file

@ -45,7 +45,7 @@ impl From<PError> for IronError {
pub fn get_api_handler(collection: Arc<Mutex<Collection>>) -> Mount {
let mut api_handler = Mount::new();
{
let collection = collection.clone();
api_handler.mount("/auth/", move |request: &mut Request| {

View file

@ -291,7 +291,7 @@ impl Collection {
Some(n) => n,
};
let user = User{
let user = User {
name: name.to_owned(),
password: password.to_owned(),
};
@ -343,7 +343,7 @@ impl Collection {
}
pub fn auth(&self, username: &str, password: &str) -> bool {
self.users.iter().any(|u| u.name == username && u.password == password )
self.users.iter().any(|u| u.name == username && u.password == password)
}
pub fn browse(&self, path: &Path) -> Result<Vec<CollectionFile>, PError> {

View file

@ -78,9 +78,7 @@ impl fmt::Display for PError {
PError::ConfigFileOpenError => write!(f, "Could not open config file"),
PError::ConfigFileReadError => write!(f, "Could not read config file"),
PError::ConfigFileParseError => write!(f, "Could not parse config file"),
PError::ConfigUsersParseError => {
write!(f, "Could not parse users in config file")
}
PError::ConfigUsersParseError => write!(f, "Could not parse users in config file"),
PError::ConfigMountDirsParseError => {
write!(f, "Could not parse mount directories in config file")
}