MCPcopy Create free account
hub / github.com/PRQL/prql / render_log_to_html

Function render_log_to_html

prqlc/prqlc/src/debug/render_html.rs:14–30  ·  view source on GitHub ↗
(writer: W, debug_log: &DebugLog)

Source from the content-addressed store, hash-verified

12use prqlc_parser::parser::pr;
13
14pub fn render_log_to_html<W: std::io::Write>(writer: W, debug_log: &DebugLog) -> core::fmt::Result {
15 struct IoWriter<W: std::io::Write> {
16 inner: W,
17 }
18
19 impl<W: std::io::Write> core::fmt::Write for IoWriter<W> {
20 fn write_str(&mut self, s: &str) -> std::fmt::Result {
21 self.inner
22 .write(s.as_bytes())
23 .map_err(|_| std::fmt::Error)?;
24 Ok(())
25 }
26 }
27 let mut io_writer = IoWriter { inner: writer };
28
29 write_debug_log(&mut io_writer, debug_log)
30}
31
32fn write_debug_log<W: Write>(w: &mut W, debug_log: &DebugLog) -> Result {
33 writeln!(w, "<!doctype html>")?;

Callers 1

write_logFunction · 0.85

Calls 1

write_debug_logFunction · 0.85

Tested by

no test coverage detected