global: remove useless file and change comment to be more accurate
This commit is contained in:
parent
77a9362425
commit
6f8533f91b
2 changed files with 1 additions and 22 deletions
|
|
@ -20,7 +20,7 @@ async fn main() {
|
|||
.fallback(notfound)
|
||||
.with_state(state);
|
||||
|
||||
// We need to include this flag so that the live reload layer isn't included when the server is built
|
||||
// We need to include this flag so that the live reload layer isn't included when the server is deployed
|
||||
#[cfg(debug_assertions)]
|
||||
let app = app.layer(LiveReloadLayer::new());
|
||||
|
||||
|
|
|
|||
21
src/state.rs
21
src/state.rs
|
|
@ -1,21 +0,0 @@
|
|||
pub struct AppState {
|
||||
mp_tracks: Vec<Track>,
|
||||
p_tracks: Vec<Track>,
|
||||
}
|
||||
|
||||
impl AppState {
|
||||
async fn try_new() -> Self {
|
||||
Self {
|
||||
mp_tracks: serde_json::from_str(
|
||||
&std::fs::read_to_string("content/mp-tracks.json")
|
||||
.expect("mp-tracks.json non trouvé"),
|
||||
)
|
||||
.expect("JSON invalide"),
|
||||
p_tracks: serde_json::from_str(
|
||||
&std::fs::read_to_string("content/p-tracks.json")
|
||||
.expect("p-tracks.json non trouvé"),
|
||||
)
|
||||
.expect("JSON invalide"),
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue