Add helper for class name (#255)

This commit is contained in:
Joe Hoyle 2023-07-19 13:13:12 +02:00 committed by GitHub
parent 3e378f8cdf
commit 4e8bec7995
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,6 +79,10 @@ impl ClassEntry {
Self::try_find(name.as_str().ok()?)
}
}
pub fn name(&self) -> Option<&str> {
unsafe { self.name.as_ref().and_then(|s| s.as_str().ok()) }
}
}
impl PartialEq for ClassEntry {