lingdu1234 / axum_admin

axum admin rust vue
https://314.iu1314.top/
227 stars 42 forks source link

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

Closed makorne closed 1 year ago

makorne commented 1 year 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 1 year ago

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