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

Function columns_pretty

src/transform/src/typecheck.rs:1685–1705  ·  view source on GitHub ↗

Prints a type prettily with a given `ExprHumanizer`

(cols: &[ReprColumnType], humanizer: &H)

Source from the content-addressed store, hash-verified

1683
1684/// Prints a type prettily with a given `ExprHumanizer`
1685pub fn columns_pretty<H>(cols: &[ReprColumnType], humanizer: &H) -> String
1686where
1687 H: ExprHumanizer,
1688{
1689 let mut s = String::with_capacity(2 + 3 * cols.len());
1690
1691 s.push('(');
1692
1693 let mut it = cols.iter().peekable();
1694 while let Some(col) = it.next() {
1695 s.push_str(&humanizer.humanize_column_type(col));
1696
1697 if it.peek().is_some() {
1698 s.push_str(", ");
1699 }
1700 }
1701
1702 s.push(')');
1703
1704 s
1705}
1706
1707impl ReprRelationTypeDifference {
1708 /// Pretty prints a type difference

Callers 1

humanizeMethod · 0.85

Calls 7

is_someMethod · 0.80
lenMethod · 0.45
pushMethod · 0.45
iterMethod · 0.45
nextMethod · 0.45
humanize_column_typeMethod · 0.45
peekMethod · 0.45

Tested by

no test coverage detected