You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 12, 2025. It is now read-only.
virtme-ng-init: fix build error with older versions of rustc
In older versions of rustc (such as 1.66.1) we can trigger the following
build error:
error[E0308]: mismatched types
--> src/main.rs:632:20
|
632 | ("su", vec![&user, "-c", USER_SCRIPT])
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| expected slice, found array `[&str; 3]`
| arguments to this function are incorrect
|
= note: expected struct `Box<[&String], _>`
found struct `Box<[&str; 3], std::alloc::Global>`
This happens becausee we are using a mixture of &String and &str types
with the vec! macro.
To prevent this make sure that the types match, by explicitly converting
user to &str when creating the vector.
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
0 commit comments