Skip to content

Commit

Permalink
fix: put the shared pointer at the right place
Browse files Browse the repository at this point in the history
  • Loading branch information
gabyx committed Oct 3, 2024
1 parent 8950754 commit 95f816c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions fuzon-http/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct Config {
#[derive(Clone, Debug)]
struct AppState {
// TODO: Add doc what these dict maps.
collections: Arc<HashMap<String, TermMatcher>>,
collections: HashMap<String, TermMatcher>,
}

impl AppState {
Expand All @@ -60,9 +60,7 @@ impl AppState {

info!("Initialized with: {:?}", &data);

AppState {
collections: Arc::new(collections),
}
AppState { collections }
}
}

Expand Down Expand Up @@ -122,7 +120,7 @@ async fn async_main() -> std::io::Result<()> {
let host = config.host.clone();
let port = config.port as u16;

let data = AppState::from_config(config);
let data = Arc::new(AppState::from_config(config));

HttpServer::new(move || {
App::new()
Expand Down

0 comments on commit 95f816c

Please sign in to comment.