Disconnect after getting URL
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
bcd3861fe0
commit
74e2303652
1 changed files with 3 additions and 2 deletions
|
@ -31,7 +31,7 @@ async fn main() -> Result<(), Option<()>> {
|
|||
.build()
|
||||
.unwrap();
|
||||
|
||||
while let Some(events) = client.wait_for_events().await {
|
||||
'outer: while let Some(events) = client.wait_for_events().await {
|
||||
for event in events {
|
||||
match event {
|
||||
Event::Online => {
|
||||
|
@ -43,10 +43,11 @@ async fn main() -> Result<(), Option<()>> {
|
|||
}
|
||||
Event::HTTPUploadedFile(url) => {
|
||||
println!("URL: {}", url);
|
||||
client.disconnect().await.unwrap();
|
||||
},
|
||||
Event::Disconnected => {
|
||||
println!("Disconnected");
|
||||
return Err(None);
|
||||
break 'outer;
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue