~repos /rust-embed

#rust#proc-macro#http

git clone https://pyrossh.dev/repos/rust-embed.git

rust macro which loads files into the rust binary at compile time during release and loads the file from the fs during dev.


20c6c7fc frederikhors

3 years ago
use path only
Files changed (1) hide show
  1. examples/axum-spa/main.rs +1 -1
examples/axum-spa/main.rs CHANGED
@@ -33,7 +33,7 @@ async fn static_handler(uri: Uri) -> impl IntoResponse {
33
33
  return index_html().await.into_response();
34
34
  }
35
35
 
36
- match Assets::get(path.as_str()) {
36
+ match Assets::get(path) {
37
37
  Some(content) => {
38
38
  let body = boxed(Full::from(content.data));
39
39
  let mime = mime_guess::from_path(path).first_or_octet_stream();