~repos /rust-embed

#rust#proc-macro#http

git clone https://pyrossh.dev/repos/rust-embed.git
Discussions: https://groups.google.com/g/rust-embed-devs

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


Files changed (1) hide show
  1. examples/axum-spa/main.rs +2 -4
examples/axum-spa/main.rs CHANGED
@@ -1,6 +1,6 @@
1
1
  use axum::{
2
2
  http::{header, StatusCode, Uri},
3
- response::{IntoResponse, Response, Html},
3
+ response::{Html, IntoResponse, Response},
4
4
  routing::Router,
5
5
  };
6
6
  use rust_embed::RustEmbed;
@@ -46,9 +46,7 @@ async fn static_handler(uri: Uri) -> impl IntoResponse {
46
46
 
47
47
  async fn index_html() -> Response {
48
48
  match Assets::get(INDEX_HTML) {
49
- Some(content) => {
50
- Html(content.data).into_response()
49
+ Some(content) => Html(content.data).into_response(),
51
- }
52
50
  None => not_found().await,
53
51
  }
54
52
  }