automatic cargo CI changes

This commit is contained in:
cscherrNT 2024-06-27 11:17:48 +00:00 committed by github-actions[bot]
parent 2edb979aef
commit d6a8514d39
2 changed files with 3 additions and 3 deletions

View File

@ -44,7 +44,7 @@ fn repl(conn: &mut SqliteConnection) -> anyhow::Result<()> {
Some(i) => i,
None => continue,
};
if let Err(e) = Post::publish(conn, id){
if let Err(e) = Post::publish(conn, id) {
if let Some(e) = e.downcast_ref::<diesel::result::Error>() {
if matches!(e, diesel::result::Error::NotFound) {
warn!("No post with id {id} exists");
@ -56,7 +56,7 @@ fn repl(conn: &mut SqliteConnection) -> anyhow::Result<()> {
Some(i) => i,
None => continue,
};
if let Err(e) = Post::delete(conn, id){
if let Err(e) = Post::delete(conn, id) {
if let Some(e) = e.downcast_ref::<diesel::result::Error>() {
if matches!(e, diesel::result::Error::NotFound) {
warn!("No post with id {id} exists");

View File

@ -33,7 +33,7 @@ impl Post {
Ok(())
}
pub fn delete(conn: &mut SqliteConnection, id: i32) -> anyhow::Result<()> {
use crate::schema::posts::dsl::{posts, published};
use crate::schema::posts::dsl::posts;
let post = diesel::delete(posts.find(id))
.returning(Post::as_returning())