message: util: Add iterator join method
diff: +use std::fmt;
  use std::time::Duration;
  pub use self::canonical_url::CanonicalUrl;
  @@ -75,6 +76,32 @@ pub fn elapsed(duration: Duration) -> String {
  }
  }
  +pub fn iter_join_onto<W, I, T>(mut w: W, iter: I, delim: &str) -> fmt::Result
  +where
  + W: fmt::Write,
  + I: IntoIterator<Item = T>,
  + T: std::fmt::Display,
  +{
  + let mut it = iter.into_iter().peekable();
  + while let Some(n) = it.next() {
  + write!(w, "{}", n)?;
  + if it.peek().is_some() {
  + write!(w, "{}", delim)?;
  + }
  + }
  + Ok(())
  +}
  +
  +pub fn iter_join<I, T>(iter: I, delim: &str) -> String
  +where
  + I: IntoIterator<Item = T>,
  + T: std::fmt::Display,
  +{
  + let mut s = String::new();
  + let _ = iter_join_onto(&mut s, iter, delim);
  + s
  +}
  +
  /// Whether or not this running in a Continuous Integration environment.
  pub fn is_ci() -> bool {
  std::env::var("CI").is_ok() || std::env::var("TF_BUILD").is_ok()
  