lingdu1234 / axum_admin

axum admin rust vue
https://314.iu1314.top/
239 stars 45 forks source link

No item named const_new` found for struct `tokio::sync::OnceCell #12

Closed makorne closed 2 years ago

makorne commented 2 years ago

Hi! Thank you for great crates!

Compiling db v0.1.0
error[E0599]: no function or associated item named `const_new` found for struct `tokio::sync::OnceCell` in the current scope
 --> db/src/db.rs:7:57
  |
7 | pub static DB: OnceCell<DatabaseConnection> = OnceCell::const_new();
  |                                                         ^^^^^^^^^ function or associated item not found in `tokio::sync::OnceCell<_>`

cargo 1.65.0 (4bc8f24d3 2022-10-20)

lingdu1234 commented 2 years ago

replace with tokio = {workspace = true,default-features =false,features=["parking_lot"]} in db's cargo.toml