branca icon indicating copy to clipboard operation
branca copied to clipboard

Do not consume self on builder getters

Open brycx opened this issue 4 years ago • 0 comments

key(), nonce(), ttl() and timestamp() all consume self. This means the builders instance needs to be cloned if a user wants to continue using it after calling any of the above getters. This seems unintentional. I suggest they all take &self instead of self.

pub fn nonce(&self) -> &[u8] {
        self.nonce
}

brycx avatar Nov 29 '20 11:11 brycx