How to default-initialize a struct containing an array in Rust?

前端 未结 4 623
难免孤独
难免孤独 2021-01-11 10:31

What is the recommended way to declare a struct that contains an array, and then create a zero-initialized instance?

Here is the struct:

#[derive(De         


        
4条回答
  •  青春惊慌失措
    2021-01-11 11:30

    Indeed, at the time of writing, support for fixed-length arrays is still being hashed out in the standard library:

    https://github.com/rust-lang/rust/issues/7622

提交回复
热议问题