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()
|
.build()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
while let Some(events) = client.wait_for_events().await {
|
'outer: while let Some(events) = client.wait_for_events().await {
|
||||||
for event in events {
|
for event in events {
|
||||||
match event {
|
match event {
|
||||||
Event::Online => {
|
Event::Online => {
|
||||||
|
@ -43,10 +43,11 @@ async fn main() -> Result<(), Option<()>> {
|
||||||
}
|
}
|
||||||
Event::HTTPUploadedFile(url) => {
|
Event::HTTPUploadedFile(url) => {
|
||||||
println!("URL: {}", url);
|
println!("URL: {}", url);
|
||||||
|
client.disconnect().await.unwrap();
|
||||||
},
|
},
|
||||||
Event::Disconnected => {
|
Event::Disconnected => {
|
||||||
println!("Disconnected");
|
println!("Disconnected");
|
||||||
return Err(None);
|
break 'outer;
|
||||||
}
|
}
|
||||||
_ => (),
|
_ => (),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue