mmal-sys icon indicating copy to clipboard operation
mmal-sys copied to clipboard

Rust 2021/analyser fix

Open vvvy opened this issue 1 year ago • 0 comments

Basic Rust 2021 compatibility.

In particular, this PR fixes the following error that appear under rust-analyzer:

error[E0308]: mismatched types
   --> /workspaces/src/mmal-sys/src/lib.rs:290:35
    |
290 |             ::std::str::from_utf8(&self.camera_name).unwrap(),
    |             --------------------- ^^^^^^^^^^^^^^^^^ expected slice `[u8]`, found array `[i8; 16]`
    |             |
    |             arguments to this function are incorrect
    |
    = note: expected reference `&[u8]`
               found reference `&[i8; 16]`
note: function defined here
   --> /usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/converts.rs:87:14
    |
87  | pub const fn from_utf8(v: &[u8]) -> Result<&str, Utf8Error> {
    |              ^^^^^^^^^


vvvy avatar Jun 21 '23 02:06 vvvy