automatic cargo CI changes
This commit is contained in:
parent
2edb979aef
commit
d6a8514d39
|
@ -44,7 +44,7 @@ fn repl(conn: &mut SqliteConnection) -> anyhow::Result<()> {
|
||||||
Some(i) => i,
|
Some(i) => i,
|
||||||
None => continue,
|
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 let Some(e) = e.downcast_ref::<diesel::result::Error>() {
|
||||||
if matches!(e, diesel::result::Error::NotFound) {
|
if matches!(e, diesel::result::Error::NotFound) {
|
||||||
warn!("No post with id {id} exists");
|
warn!("No post with id {id} exists");
|
||||||
|
@ -56,7 +56,7 @@ fn repl(conn: &mut SqliteConnection) -> anyhow::Result<()> {
|
||||||
Some(i) => i,
|
Some(i) => i,
|
||||||
None => continue,
|
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 let Some(e) = e.downcast_ref::<diesel::result::Error>() {
|
||||||
if matches!(e, diesel::result::Error::NotFound) {
|
if matches!(e, diesel::result::Error::NotFound) {
|
||||||
warn!("No post with id {id} exists");
|
warn!("No post with id {id} exists");
|
||||||
|
|
|
@ -33,7 +33,7 @@ impl Post {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
pub fn delete(conn: &mut SqliteConnection, id: i32) -> anyhow::Result<()> {
|
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))
|
let post = diesel::delete(posts.find(id))
|
||||||
.returning(Post::as_returning())
|
.returning(Post::as_returning())
|
||||||
|
|
Loading…
Reference in New Issue