mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-21 04:58:42 +00:00
Impl IntoIterator
for &Targets
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
bd224f7186
commit
1d71f92ee6
1 changed files with 10 additions and 0 deletions
|
@ -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<str>;
|
||||
type IntoIter = slice::Iter<'a, Box<str>>;
|
||||
|
||||
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.
|
||||
|
|
Loading…
Add table
Reference in a new issue