Skip to content

Commit

Permalink
Update sea-orm-rocket
Browse files Browse the repository at this point in the history
  • Loading branch information
wyatt-herkamp committed Nov 3, 2023
1 parent 07bb07f commit b7226bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sea-orm-rocket/codegen/src/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub fn derive_database(input: TokenStream) -> TokenStream {
) -> rocket::request::Outcome<Self, Self::Error> {
match #db_ty::fetch(req.rocket()) {
Some(db) => rocket::outcome::Outcome::Success(db),
None => rocket::outcome::Outcome::Failure((
None => rocket::outcome::Outcome::Error((
rocket::http::Status::InternalServerError, ()))
}
}
Expand Down
6 changes: 3 additions & 3 deletions sea-orm-rocket/lib/src/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ pub trait Database:
}

let dbtype = std::any::type_name::<Self>();
let fairing = Paint::default(format!("{dbtype}::init()")).bold();
let fairing = Paint::new(format!("{dbtype}::init()")).bold();
error!(
"Attempted to fetch unattached database `{}`.",
Paint::default(dbtype).bold()
Paint::new(dbtype).bold()
);
info_!(
"`{}` fairing must be attached prior to using this database.",
Expand Down Expand Up @@ -261,7 +261,7 @@ impl<'r, D: Database> FromRequest<'r> for Connection<'r, D> {
async fn from_request(req: &'r Request<'_>) -> Outcome<Self, Self::Error> {
match D::fetch(req.rocket()) {
Some(pool) => Outcome::Success(Connection(pool.borrow())),
None => Outcome::Failure((Status::InternalServerError, None)),
None => Outcome::Error((Status::InternalServerError, None)),
}
}
}
Expand Down

0 comments on commit b7226bb

Please sign in to comment.