diff --git a/src/target.rs b/src/target.rs index 6c8d9f09..2bd52a6e 100644 --- a/src/target.rs +++ b/src/target.rs @@ -3,6 +3,7 @@ use std::io::{BufRead, Cursor}; use std::iter::IntoIterator; use std::ops::Deref; use std::process::Output; +use std::slice; use tokio::process::Command; /// Compiled target triple, used as default for binary fetching @@ -44,6 +45,15 @@ impl IntoIterator for Targets { } } +impl<'a> IntoIterator for &'a Targets { + type Item = &'a Box; + type IntoIter = slice::Iter<'a, Box>; + + fn into_iter(self) -> Self::IntoIter { + (&self.0).into_iter() + } +} + /// Detect the targets supported at runtime, /// which might be different from `TARGET` which is detected /// at compile-time.