summaryrefslogtreecommitdiff
path: root/rust/src/metadata.rs
diff options
context:
space:
mode:
authorKyleMiles <krm504@nyu.edu>2023-01-05 17:29:14 -0500
committerKyleMiles <krm504@nyu.edu>2023-01-06 16:29:58 -0500
commita154e45cce79b0c2264c1e1cd37a3d1bf5bc6154 (patch)
tree11f436b720edfdf37819e9e83e7131d220687074 /rust/src/metadata.rs
parent52edc39a7081fd6662e14fbcd473adabbbc36c7a (diff)
Rust API: Lots and lots of clippy changes
Diffstat (limited to 'rust/src/metadata.rs')
-rw-r--r--rust/src/metadata.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/rust/src/metadata.rs b/rust/src/metadata.rs
index 120a08b7..b17ba41c 100644
--- a/rust/src/metadata.rs
+++ b/rust/src/metadata.rs
@@ -1,4 +1,3 @@
-#[allow(non_snake_case)]
use crate::rc::{
Array, CoreArrayProvider, CoreArrayWrapper, CoreOwnedArrayProvider, Guard, Ref, RefCountable,
};
@@ -236,6 +235,10 @@ impl Metadata {
unsafe { BNMetadataSize(self.handle) }
}
+ pub fn is_empty(&self) -> bool {
+ unsafe { BNMetadataSize(self.handle) == 0 }
+ }
+
pub fn index(&self, index: usize) -> Result<Option<Ref<Metadata>>, ()> {
if self.get_type() != MetadataType::ArrayDataType {
return Err(());