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

Method fmt

cranelift/codegen/src/settings.rs:130–144  ·  view source on GitHub ↗
(&self, f: &mut fmt::Formatter)

Source from the content-addressed store, hash-verified

128
129impl fmt::Display for Value {
130 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
131 if let Some(enum_variant) = self.as_enum() {
132 write!(f, "{}={}", self.name, enum_variant)
133 } else if let Some(num) = self.as_num() {
134 write!(f, "{}={}", self.name, num)
135 } else if let Some(b) = self.as_bool() {
136 if b {
137 write!(f, "{}=1", self.name)
138 } else {
139 write!(f, "{}=0", self.name)
140 }
141 } else {
142 unreachable!()
143 }
144 }
145}
146
147/// Collect settings values based on a template.

Callers

nothing calls this directly

Calls 3

as_enumMethod · 0.80
as_numMethod · 0.80
as_boolMethod · 0.45

Tested by

no test coverage detected