forked from Plume/Plume
replace if / else with ok_or()
This commit is contained in:
parent
468e663344
commit
1c34ac38f7
1 changed files with 1 additions and 8 deletions
|
@ -202,14 +202,7 @@ impl Blog {
|
|||
.load::<Blog>(&*c.conn)?
|
||||
.into_iter()
|
||||
.next();
|
||||
if let Some(from_db) = from_db {
|
||||
Ok(from_db)
|
||||
} else {
|
||||
// we should never get here, because
|
||||
// a) load::<Blog>()? should return early if it fails
|
||||
// b) this function is only called after a Request::guard::<Host>()
|
||||
Err(Error::NotFound)
|
||||
}
|
||||
from_db.ok_or(Error::NotFound)
|
||||
}
|
||||
|
||||
fn fetch_from_webfinger(c: &PlumeRocket, acct: &str) -> Result<Blog> {
|
||||
|
|
Loading…
Reference in a new issue