MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / fmt

Method fmt

src/sql-parser/src/ast/defs/name.rs:382–396  ·  view source on GitHub ↗
(&self, f: &mut AstFormatter<W>)

Source from the content-addressed store, hash-verified

380/// Quotation is forced when printing in Stable mode.
381impl AstDisplay for Ident {
382 fn fmt<W: fmt::Write>(&self, f: &mut AstFormatter<W>) {
383 if self.can_be_printed_bare() && !f.stable() {
384 f.write_str(&self.0);
385 } else {
386 f.write_str("\"");
387 for ch in self.0.chars() {
388 // Double up on double-quotes.
389 if ch == '"' {
390 f.write_str("\"");
391 }
392 f.write_str(ch);
393 }
394 f.write_str("\"");
395 }
396 }
397}
398impl_display!(Ident);
399

Callers

nothing calls this directly

Calls 5

can_be_printed_bareMethod · 0.80
stableMethod · 0.80
write_nodeMethod · 0.80
separatedFunction · 0.50
write_strMethod · 0.45

Tested by

no test coverage detected