mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-11-04 09:34:04 +00:00
Improve code
This commit is contained in:
@@ -75,10 +75,8 @@ pub fn create(p: &Post) -> ResultBoxError<u64> {
|
||||
.add_opt_str("texte", p.content.as_ref());
|
||||
|
||||
// Execute insertion
|
||||
let post_id = match insert_query.insert()? {
|
||||
None => Err(ExecError::new("Insert post query did not return a result!")),
|
||||
Some(id) => Ok(id),
|
||||
}?;
|
||||
let post_id = insert_query.insert()?
|
||||
.ok_or(ExecError::new("Insert post query did not return a result!"))?;
|
||||
|
||||
Ok(post_id)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user