Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/impl_const_default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ impl<T: ConstDefault, U: ConstDefault> ConstDefault for GenericArrayImplOdd<T, U
}

impl<T, U: ArrayLength<T>> ConstDefault for GenericArray<T, U>
where U::ArrayType: ConstDefault,
where
U::ArrayType: ConstDefault,
{
const DEFAULT: Self = Self { data: ConstDefault::DEFAULT };
const DEFAULT: Self = Self {
data: ConstDefault::DEFAULT,
};
}
5 changes: 2 additions & 3 deletions src/impl_zeroize.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use {ArrayLength, GenericArray};
use crate::{ArrayLength, GenericArray};

use zeroize::Zeroize;

#[cfg_attr(docsrs, doc(cfg(feature = "zeroize")))]
impl<T: Zeroize, N: ArrayLength<T>> Zeroize for GenericArray<T, N> {
fn zeroize(&mut self) {
self.as_mut_slice().iter_mut().zeroize()
Expand All @@ -22,4 +21,4 @@ mod tests {
assert_eq!(array[0], 0);
assert_eq!(array[1], 0);
}
}
}
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
#![deny(missing_docs)]
#![deny(meta_variable_misuse)]
#![no_std]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]

#[cfg(feature = "const-default")]
extern crate const_default;
Expand Down
2 changes: 1 addition & 1 deletion tests/arr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ fn const_context() {
fn repeat_expression() {
let ar = arr![u8; 0xc0; typenum::U4];
assert_eq!(format!("{:x}", ar), "c0c0c0c0");
}
}