forked from BigfootDev/flatbuffers
Mark endian_scalar as unsafe. (#6588)
* Mark endian_scalar as unsafe. Also - removed the deprecated flexbuffer slice from example - fixed some cargo warnings * Assertions and read_scalar made unsafe * Clippy lints * Add to Safety Co-authored-by: Casper Neo <cneo@google.com>
This commit is contained in:
@@ -37,6 +37,8 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::len_without_is_empty)]
|
||||
#[allow(clippy::from_over_into)] // TODO(caspern): Go from From to Into.
|
||||
impl<'a, T: 'a, const N: usize> Array<'a, T, N> {
|
||||
#[inline(always)]
|
||||
pub fn new(buf: &'a [u8]) -> Self {
|
||||
@@ -49,7 +51,7 @@ impl<'a, T: 'a, const N: usize> Array<'a, T, N> {
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub fn len(&self) -> usize {
|
||||
pub const fn len(&self) -> usize {
|
||||
N
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user