mirror of
https://github.com/AleoHQ/leo.git
synced 2024-12-21 00:21:47 +03:00
Change match to if
This commit is contained in:
parent
707168de0a
commit
3b81e6a219
@ -41,11 +41,8 @@ impl CLI for LoginCommand {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
match Path::new(LEO_CREDENTIALS_DIR).exists() {
|
if !Path::new(LEO_CREDENTIALS_DIR).exists() {
|
||||||
true => {}
|
create_dir(LEO_CREDENTIALS_DIR)?;
|
||||||
false => {
|
|
||||||
create_dir(LEO_CREDENTIALS_DIR)?;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut credentials = File::create(&format!("{}/{}", LEO_CREDENTIALS_DIR, LEO_CREDENTIALS_FILE))?;
|
let mut credentials = File::create(&format!("{}/{}", LEO_CREDENTIALS_DIR, LEO_CREDENTIALS_FILE))?;
|
||||||
@ -56,7 +53,6 @@ impl CLI for LoginCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run tests in single thread
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
|
||||||
@ -117,6 +113,7 @@ mod tests {
|
|||||||
let token = "SOME_TOKEN".to_string();
|
let token = "SOME_TOKEN".to_string();
|
||||||
let options = Some(token.clone());
|
let options = Some(token.clone());
|
||||||
LoginCommand::output(options).unwrap();
|
LoginCommand::output(options).unwrap();
|
||||||
|
|
||||||
assert_eq!(token, get_token(suffix)?);
|
assert_eq!(token, get_token(suffix)?);
|
||||||
clean(suffix)?;
|
clean(suffix)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
Loading…
Reference in New Issue
Block a user