MCPcopy Create free account
hub / github.com/Stranger6667/css-inline / format_error

Function format_error

css-inline/src/main.rs:203–211  ·  view source on GitHub ↗
(filename: Option<&str>, error: impl fmt::Display)

Source from the content-addressed store, hash-verified

201 }
202
203 fn format_error(filename: Option<&str>, error: impl fmt::Display) {
204 let mut buffer = String::with_capacity(128);
205 if let Some(filename) = filename {
206 writeln!(buffer, "Filename: {filename}").expect("Failed to write to buffer");
207 }
208 buffer.push_str("Status: ERROR\n");
209 writeln!(buffer, "Details: {error}").expect("Failed to write to buffer");
210 eprintln!("{}", buffer.trim());
211 }
212
213 const VERSION_MESSAGE: &[u8] =
214 concat!("css-inline ", env!("CARGO_PKG_VERSION"), "\n").as_bytes();

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected