Skip to content

Commit ad87fb2

Browse files
committed
video example
1 parent e3dbd63 commit ad87fb2

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

examples/video/src/main.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ async fn create_video(client: &Client<OpenAIConfig>) -> Result<VideoJob, Box<dyn
6969
#[tokio::main]
7070
async fn main() -> Result<(), Box<dyn Error>> {
7171
let client = Client::new();
72-
let _video = create_video(&client).await?;
72+
let video = create_video(&client).await?;
7373
// wait for above video to be "completed"
7474
tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
7575
let videos = client.videos().list(&[("limit", "100")]).await?;
@@ -92,12 +92,10 @@ async fn main() -> Result<(), Box<dyn Error>> {
9292
}
9393
}
9494

95-
for video in videos.data {
96-
println!(
97-
"\nVideo deleted: {:?}",
98-
client.videos().delete(&video.id).await?
99-
);
100-
}
95+
println!(
96+
"\nVideo deleted: {:?}",
97+
client.videos().delete(&video.id).await?
98+
);
10199

102100
Ok(())
103101
}

0 commit comments

Comments
 (0)