mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-05-16 23:55:42 +02:00
It makes no sense to use both return and ?.
This commit is contained in:
parent
52d28b155b
commit
9fa0e89e90
@ -23,7 +23,7 @@ fn read_username(path: &str) -> Result<String> {
|
||||
.read_to_string(&mut username)
|
||||
.context("Failed to read")?;
|
||||
if username.is_empty() {
|
||||
return Err(ReadUsernameError::EmptyUsername(String::from(path)))?;
|
||||
return Err(ReadUsernameError::EmptyUsername(String::from(path)).into());
|
||||
}
|
||||
Ok(username)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user