Fix compile error

This commit is contained in:
Nathan Sobo 2022-04-25 20:12:32 -06:00
parent 2bd08a7b3f
commit 3938f7c364

View file

@ -24,7 +24,7 @@ pub struct AppState {
}
impl AppState {
async fn new(config: Config) -> Result<Arc<Self>> {
async fn new(config: &Config) -> Result<Arc<Self>> {
let db = PostgresDb::new(&config.database_url, 5).await?;
let this = Self {
db: Arc::new(db),
@ -50,7 +50,7 @@ async fn main() -> Result<()> {
}
let config = envy::from_env::<Config>().expect("error loading config");
let state = AppState::new(config).await?;
let state = AppState::new(&config).await?;
let rpc = Peer::new();
run_server(
state.clone(),