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

Method from_format_args

crates/core/src/error/macros.rs:349–365  ·  view source on GitHub ↗
(args: fmt::Arguments<'_>)

Source from the content-addressed store, hash-verified

347 /// Only for use by the `format_err!` macro.
348 #[doc(hidden)]
349 pub fn from_format_args(args: fmt::Arguments<'_>) -> Self {
350 if let Some(s) = args.as_str() {
351 return Self::msg(s);
352 }
353
354 let mut f = Formatter::default();
355 match write(&mut f, args) {
356 Ok(()) => {
357 debug_assert!(f.oom.is_none());
358 Error::msg(f.message)
359 }
360 Err(fmt_error) => match f.oom {
361 Some(oom) => Error::new(oom),
362 None => Error::new(fmt_error),
363 },
364 }
365 }
366 }
367}
368

Callers

nothing calls this directly

Calls 4

msgFunction · 0.85
writeFunction · 0.50
newFunction · 0.50
as_strMethod · 0.45

Tested by

no test coverage detected