error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
--> src/backend.rs:38:1
|
38 | / pub fn generate_preferred_uds_path() -> Result<std::path::Path, std::env::VarError> {
39 | | Ok(*std::path::Path::new(&std::env::var("XDG_RUNTIME_DIR")?))
40 | | }
| |_^ borrow the `Path` instead
|
= help: within `std::path::Path`, the trait `std::marker::Sized` is not implemented for `[u8]`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
= note: required because it appears within the type `std::path::Path`
= note: required by `std::result::Result`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.
error: Could not compile `events`.
I don't understand this error message, of course, the size of [u8] is a runtime variable. How can I create a path in runtime with String
?