message: Remove unneeded box trait and return `impl Iterator` instead
diff: @@ -48,7 +48,7 @@ impl Completer for IonFileCompleter {
  if let Some(expanded) = unsafe { (*self.vars).tilde_expansion(start, &*self.dir_stack) }
  {
  // Now we obtain completions for the `expanded` form of the `start` value.
  - let mut iterator = FilenameCompletion::new(&expanded, |x| self.inner.completions(x));
  + let mut iterator = filename_completion(&expanded, |x| self.inner.completions(x));
  // And then we will need to take those completions and remove the expanded form
  // of the tilde pattern and replace it with that pattern yet again.
  @@ -91,16 +91,14 @@ impl Completer for IonFileCompleter {
  }
  }
  - FilenameCompletion::new(&start, |x| self.inner.completions(x)).collect()
  + filename_completion(&start, |x| self.inner.completions(x)).collect()
  }
  }
  -pub struct FilenameCompletion<'a> {
  - iter: Box<Iterator<Item = String> + 'a>,
  -}
  -
  -impl<'a> FilenameCompletion<'a> {
  - pub fn new<LC: Fn(&str) -> Vec<String> + 'a>(start: &'a str, liner_complete: LC) -> Self {
  +fn filename_completion<'a, LC>(start: &'a str, liner_complete: LC) -> impl Iterator<Item = String> + 'a
  +where
  + LC: Fn(&str) -> Vec<String> + 'a
  +{
  let unescaped_start = unescape(start);
  let split_start = unescaped_start.split("/");
  @@ -141,24 +139,11 @@ impl<'a> FilenameCompletion<'a> {
  // Use Liner::Completer as well, to preserve the previous behaviour
  // around single-directory completions
  - let iter = iter_inner_glob.flat_map(move |path| {
  + iter_inner_glob.flat_map(move |path| {
  liner_complete(&path)
  .into_iter()
  .map(|x| escape(x.as_str()))
  - });
  -
  - FilenameCompletion {
  - iter: Box::new(iter),
  - }
  - }
  -}
  -
  -impl<'a> Iterator for FilenameCompletion<'a> {
  - type Item = String;
  -
  - fn next(&mut self) -> Option<Self::Item> {
  - self.iter.next()
  - }
  + })
  }
  /// Escapes filenames from the completer so that special characters will be properly escaped.
  