MCPcopy Create free account
hub / github.com/apache/datafusion / arc_map_elements_clones_when_shared

Function arc_map_elements_clones_when_shared

datafusion/common/src/tree_node.rs:2472–2480  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2470
2471 #[test]
2472 fn arc_map_elements_clones_when_shared() {
2473 // When the input `Arc` is shared, `make_mut` clones into a fresh
2474 // allocation, so the reuse optimization does not apply.
2475 let arc = Arc::new(TestTreeNode::new_leaf(42i32));
2476 let _keepalive = Arc::clone(&arc);
2477 let before = Arc::as_ptr(&arc);
2478 let out = arc.map_elements(|n| Ok(Transformed::no(n))).unwrap();
2479 assert_ne!(Arc::as_ptr(&out.data), before);
2480 }
2481
2482 #[test]
2483 fn box_map_elements_panic() {

Callers

nothing calls this directly

Calls 2

newFunction · 0.85
map_elementsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…