MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / values_rev

Function values_rev

cranelift/entity/src/boxed_slice.rs:291–315  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

289
290 #[test]
291 fn values_rev() {
292 let mut p: PrimaryMap<E, usize> = PrimaryMap::new();
293 p.push(12);
294 p.push(33);
295 let mut m = p.into_boxed_slice();
296
297 let mut i = 2;
298 for value in m.values().rev() {
299 i -= 1;
300 match i {
301 0 => assert_eq!(*value, 12),
302 1 => assert_eq!(*value, 33),
303 _ => panic!(),
304 }
305 }
306 i = 2;
307 for value_mut in m.values_mut().rev() {
308 i -= 1;
309 match i {
310 0 => assert_eq!(*value_mut, 12),
311 1 => assert_eq!(*value_mut, 33),
312 _ => panic!(),
313 }
314 }
315 }
316}

Callers

nothing calls this directly

Calls 5

newFunction · 0.50
pushMethod · 0.45
into_boxed_sliceMethod · 0.45
valuesMethod · 0.45
values_mutMethod · 0.45

Tested by

no test coverage detected