Change to free-fn intersperse for stdlib compat
Itertools warns that the standard library may be stabilizing the intersperse method soon and recommends using this function instead.
This commit is contained in:
@@ -6,7 +6,6 @@ use gt_tool::structs::release::{CreateReleaseOption, Release};
|
|||||||
|
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
|
|
||||||
use itertools::Itertools;
|
|
||||||
use reqwest::header;
|
use reqwest::header;
|
||||||
use reqwest::header::ACCEPT;
|
use reqwest::header::ACCEPT;
|
||||||
|
|
||||||
@@ -37,11 +36,13 @@ async fn main() -> Result<(), gt_tool::Error> {
|
|||||||
// Print in reverse order so the newest items are closest to the
|
// Print in reverse order so the newest items are closest to the
|
||||||
// user's command prompt. Otherwise the newest item scrolls off the
|
// user's command prompt. Otherwise the newest item scrolls off the
|
||||||
// screen and can't be seen.
|
// screen and can't be seen.
|
||||||
let _ = releases
|
let _ = itertools::Itertools::intersperse(
|
||||||
|
releases
|
||||||
.iter()
|
.iter()
|
||||||
.rev()
|
.rev()
|
||||||
.map(|release| release.to_string())
|
.map(|release| release.to_string()),
|
||||||
.intersperse(String::from(""))
|
String::from("")
|
||||||
|
)
|
||||||
.map(|release| println!("{}", release))
|
.map(|release| println!("{}", release))
|
||||||
.fold((), |_, _| () );
|
.fold((), |_, _| () );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user