mijit 0.2.4

Experimental JIT compiler generator
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::fmt::{self, Debug, Formatter};

/// Helper for printing comma-separated items.
pub struct CommaSeparated<I: IntoIterator, F: Fn() -> I>(pub F) where I::Item: Debug;

impl<I: IntoIterator, F: Fn() -> I> Debug for CommaSeparated<I, F> where I::Item: Debug {
    fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> {
        let mut sep = "";
        for item in self.0() {
            f.write_str(sep)?;
            item.fmt(f)?;
            sep = ", ";
        }
        Ok(())
    }
}