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

Method fmt

cranelift/bforest/src/node.rs:559–581  ·  view source on GitHub ↗
(&self, f: &mut fmt::Formatter)

Source from the content-addressed store, hash-verified

557 F::Value: ValDisp,
558{
559 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
560 match *self {
561 Self::Inner { size, keys, tree } => {
562 write!(f, "[ {}", tree[0])?;
563 for i in 0..usize::from(size) {
564 write!(f, " {} {}", keys[i], tree[i + 1])?;
565 }
566 write!(f, " ]")
567 }
568 Self::Leaf { size, keys, vals } => {
569 let keys = keys.borrow();
570 let vals = vals.borrow();
571 write!(f, "[")?;
572 for i in 0..usize::from(size) {
573 write!(f, " {}", keys[i])?;
574 vals[i].valfmt(f)?;
575 }
576 write!(f, " ]")
577 }
578 Self::Free { next: Some(n) } => write!(f, "[ free -> {n} ]"),
579 Self::Free { next: None } => write!(f, "[ free ]"),
580 }
581 }
582}
583
584#[cfg(test)]

Callers

nothing calls this directly

Calls 3

fromFunction · 0.85
valfmtMethod · 0.80
borrowMethod · 0.45

Tested by

no test coverage detected