mirror of
https://github.com/rust-embedded/heapless.git
synced 2025-10-01 06:20:34 +00:00
Use static assert
This commit is contained in:
parent
8b061aa958
commit
bf3d33676d
@ -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();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user