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:
2025-07-02 22:36:59 -05:00
parent d94c350cde
commit d4ef21e243

View File

@@ -6,7 +6,6 @@ use gt_tool::structs::release::{CreateReleaseOption, Release};
use clap::Parser;
use itertools::Itertools;
use reqwest::header;
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
// user's command prompt. Otherwise the newest item scrolls off the
// screen and can't be seen.
let _ = releases
let _ = itertools::Itertools::intersperse(
releases
.iter()
.rev()
.map(|release| release.to_string())
.intersperse(String::from(""))
.map(|release| release.to_string()),
String::from("")
)
.map(|release| println!("{}", release))
.fold((), |_, _| () );
}