Skip to content

Commit 95f816c

Browse files
committed
fix: put the shared pointer at the right place
1 parent 8950754 commit 95f816c

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

fuzon-http/src/main.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ struct Config {
4343
#[derive(Clone, Debug)]
4444
struct AppState {
4545
// TODO: Add doc what these dict maps.
46-
collections: Arc<HashMap<String, TermMatcher>>,
46+
collections: HashMap<String, TermMatcher>,
4747
}
4848

4949
impl AppState {
@@ -60,9 +60,7 @@ impl AppState {
6060

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

63-
AppState {
64-
collections: Arc::new(collections),
65-
}
63+
AppState { collections }
6664
}
6765
}
6866

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

125-
let data = AppState::from_config(config);
123+
let data = Arc::new(AppState::from_config(config));
126124

127125
HttpServer::new(move || {
128126
App::new()

0 commit comments

Comments
 (0)