Use static assert

This commit is contained in:
Yota Toyama 2025-04-07 16:40:11 -07:00
parent 8b061aa958
commit bf3d33676d

View File

@ -39,8 +39,9 @@ impl<const N: usize> CString<N> {
/// assert_eq!(empty.to_str(), Ok(""));
/// ```
pub fn new() -> Self {
// TODO Resolve this.
// crate::sealed::greater_than_0::<N>();
const {
assert!(N > 0);
}
let mut vec = Vec::new();