MCPcopy Create free account
hub / github.com/bytesnake/vim-graphical-preview / fmt

Method fmt

src/error.rs:19–37  ·  view source on GitHub ↗
(&self, f: &mut fmt::Formatter)

Source from the content-addressed store, hash-verified

17
18impl fmt::Display for Error {
19 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
20 let res = match self {
21 Error::InvalidMath(reason, element, line) =>
22 format!("could not parse math {} at {} bc. {}", element, line, reason),
23 Error::InvalidDvisvgm(err) =>
24 err.to_string(),
25 Error::FileNotFound(path) =>
26 format!("could not find file {}", path.to_str().unwrap()),
27 Error::BinaryNotFound(binary) =>
28 format!("binary not found: {}", binary),
29 Error::UnknownFence(kind) =>
30 format!("unknown fence with name {}", kind),
31 Error::InvalidImage(path) =>
32 format!("could not read in {} as image", path),
33 Error::Io(io_err) => format!("IO error: {}", io_err)
34 };
35
36 write!(f, "{}", res)
37 }
38}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected