AZ
DEFAULT_PATH тип DEFAULT_PATH. Этож lazy-staticSize: a a a
AZ
DEFAULT_PATH тип DEFAULT_PATH. Этож lazy-staticВ
lazy, нужен другой тип, который будет Deref'иться в твой. lazy-static генерирует по типу на статик, once_cell реюзает дженерик Lazy<T>p
DEFAULT_PATH тип DEFAULT_PATH. Этож lazy-staticAZ
В
once_cell и топлю, там всё понятно как работает ¯\_(ツ)_/¯AZ
AZ
В
AZ
ph
С
AZ
AZ
AZ
error[E0277]: `?` couldn't convert the error to `impl std::error::Error`
--> src\main.rs:15:56
|
15 | let user_folder_path = std::env::var("UserProfile")?;
| ^ the trait `std::convert::From<std::env::VarError>` is not implemented for `impl std::error::Error`
|
= note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
= note: required by `std::convert::From::from`В
error[E0277]: `?` couldn't convert the error to `impl std::error::Error`
--> src\main.rs:15:56
|
15 | let user_folder_path = std::env::var("UserProfile")?;
| ^ the trait `std::convert::From<std::env::VarError>` is not implemented for `impl std::error::Error`
|
= note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
= note: required by `std::convert::From::from`В
#[cfg(windows)]компилится
fn get_default_path2() -> Result<PathBuf, impl Error> {
incrinircnirnvirvnri;
}
AZ
ph
AZ
AZ