Skip to content

Commit

Permalink
chore: release
Browse files Browse the repository at this point in the history
  • Loading branch information
cilki committed Mar 17, 2024
1 parent db744f3 commit d8b970b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 23 deletions.
15 changes: 7 additions & 8 deletions goldboot/build.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
use std::{
env,
path::{Path, PathBuf},
};
use std::{env, path::PathBuf};

fn main() {
let dest =
std::path::Path::new(&env::var("OUT_DIR").expect("OUT_DIR not set")).join("built.rs");
built::write_built_file_with_opts(Some(&PathBuf::from("..")), &dest)
.expect("Failed to acquire build-time information");
if built::write_built_file().is_err() {
let dest =
std::path::Path::new(&env::var("OUT_DIR").expect("OUT_DIR not set")).join("built.rs");
built::write_built_file_with_opts(Some(&PathBuf::from("..")), &dest)
.expect("Failed to acquire build-time information");
}
}
15 changes: 0 additions & 15 deletions goldboot/src/registry/extract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,6 @@ impl FromRequest<RegistryState> for ImageHandle {
type Rejection = StatusCode;

async fn from_request(req: Request, state: &RegistryState) -> Result<Self, Self::Rejection> {
let (mut parts, body) = req.into_parts();

// We can use other extractors to provide better rejection messages.
// For example, here we are using `axum::extract::MatchedPath` to
// provide a better error message.
//
// Have to run that first since `Json` extraction consumes the request.
let path = parts
.extract::<MatchedPath>()
.await
.map(|path| path.as_str().to_owned())
.ok();

let req = Request::from_parts(parts, body);

match Path::<HashMap<String, String>>::from_request(req, state).await {
Ok(value) => match value.get("image_id") {
Some(image_id) => match ImageLibrary::find_by_id(image_id) {
Expand Down

0 comments on commit d8b970b

Please sign in to comment.