Skip to content

Commit 1d657f9

Browse files
committed
Adapt test & docs
1 parent 20bf843 commit 1d657f9

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

datafusion/common/src/heap_size.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ impl DFHeapSize for String {
397397

398398
impl DFHeapSize for str {
399399
fn heap_size(&self, _: &mut DFHeapSizeCtx) -> usize {
400+
// Internal accounting helper for owners like Arc<str>
400401
self.len()
401402
}
402403
}
@@ -631,10 +632,11 @@ mod tests {
631632
}
632633

633634
#[test]
634-
fn test_str() {
635-
let s: &str = "hello";
636-
assert!(size(s) > 0);
637-
assert_eq!(size(""), 0);
635+
fn test_owned_str() {
636+
let a: Arc<str> = Arc::from("Hello");
637+
assert!(size(&a) > 0);
638+
let a: Arc<str> = Arc::from("");
639+
assert_eq!(size(&a), 0);
638640
}
639641

640642
#[test]

0 commit comments

Comments
 (0)