Cot updates#1
Conversation
m4tx
left a comment
There was a problem hiding this comment.
Please have a look at the comments, and fix the clippy problems.
| #[derive(Eq, PartialEq, PartialOrd, Ord, Hash)] | ||
| pub struct SecureArray<T, const LENGTH: usize> | ||
| #[derive(Eq, PartialOrd, Ord, Hash)] | ||
| pub struct SecureArray<const LENGTH: usize> |
There was a problem hiding this comment.
What's the reason for removing the T generic here? If we want to keep it this way, the name is misleading. This is not SecureArray anymore, but something more like SecureFixedByteBuffer now.
| /// Be careful with `SecureVec::from`: if you have a borrowed string, it will be copied. | ||
| /// Use `SecureVec::new` if you have a `Vec<u8>`. | ||
| #[derive(Eq, PartialOrd, Ord, Hash)] | ||
| pub struct SecureVec { |
There was a problem hiding this comment.
Same question here, this is not SecureVec now. Please either change the name, or restore the generic parameter (feels like there's no real reason for removing the generic paramter, though)
| unsafe { | ||
| std::str::from_utf8_unchecked_mut(self.0.unsecure_mut()) | ||
| } | ||
| // TODO: fix |
| impl<const LENGTH: usize> From<[u8; LENGTH]> for SecureArray<LENGTH> | ||
| where | ||
| T: Copy + Zeroize, | ||
| u8: Copy + Zeroize, |
There was a problem hiding this comment.
Where's this generic bound coming from? This is always true for u8 (to be honest, I would except to compiler to throw an error at this)
|
Closing in favour of #2. |
Local fork of
secure-stringto get it working for cot-rs/cot#328