Prints a type prettily with a given `ExprHumanizer`
(cols: &[ReprColumnType], humanizer: &H)
| 1683 | |
| 1684 | /// Prints a type prettily with a given `ExprHumanizer` |
| 1685 | pub fn columns_pretty<H>(cols: &[ReprColumnType], humanizer: &H) -> String |
| 1686 | where |
| 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 | |
| 1707 | impl ReprRelationTypeDifference { |
| 1708 | /// Pretty prints a type difference |