We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 20bf843 commit 3fe1bafCopy full SHA for 3fe1baf
1 file changed
datafusion/common/src/heap_size.rs
@@ -397,6 +397,7 @@ impl DFHeapSize for String {
397
398
impl DFHeapSize for str {
399
fn heap_size(&self, _: &mut DFHeapSizeCtx) -> usize {
400
+ // Internal accounting helper for owners like Arc<str>
401
self.len()
402
}
403
@@ -631,10 +632,9 @@ mod tests {
631
632
633
634
#[test]
- fn test_str() {
635
- let s: &str = "hello";
636
- assert!(size(s) > 0);
637
- assert_eq!(size(""), 0);
+ fn test_owned_str() {
+ let a: Arc<str> = Arc::from("Hello");
+ assert!(size(&a) > 0);
638
639
640
0 commit comments