Destructuring "newtype"?


#1

I’m trying to get the underlying array for Salt from sodiumoxide - any thoughts on this?

let salt_data: [u8; SALTBYTES] = pwhash::gen_salt() is breaking for me.

help?


#2
let Salt(salt_data) = pwhash::gen_salt();

#3

This is a 1-tuple struct, so there are two way to get at the inner value:

let Salt(salt_data) = gen_salt(); // destructuring
let salt_data = gen_salt().0; // tuple indexing