MCPcopy Create free account
hub / github.com/apache/datafusion / fmt_elements_split_by_commas

Function fmt_elements_split_by_commas

datafusion/datasource/src/display.rs:115–131  ·  view source on GitHub ↗

helper formatting array elements with a comma and a space between them

(
    iter: I,
    f: &mut Formatter,
    format_element: F,
)

Source from the content-addressed store, hash-verified

113
114/// helper formatting array elements with a comma and a space between them
115fn fmt_elements_split_by_commas<E, I, F>(
116 iter: I,
117 f: &mut Formatter,
118 format_element: F,
119) -> FmtResult
120where
121 I: Iterator<Item = E>,
122 F: Fn(E, &mut Formatter) -> FmtResult,
123{
124 for (idx, element) in iter.enumerate() {
125 if idx > 0 {
126 write!(f, ", ")?;
127 }
128 format_element(element, f)?;
129 }
130 Ok(())
131}
132
133#[cfg(test)]
134mod tests {

Callers 2

fmt_asMethod · 0.85
fmt_up_to_n_elementsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…