fix(examples): Update examples to use Authenticator.

This commit is contained in:
Lewin Bormann
2019-06-13 15:32:48 +02:00
parent 48cf83e4da
commit bdb0bd92e7
3 changed files with 32 additions and 11 deletions

View File

@@ -23,6 +23,13 @@ fn main() {
println!("token is: {:?}", tok);
Ok(())
});
let fut2 = sa
.token(["https://www.googleapis.com/auth/pubsub"].iter())
.and_then(|tok| {
println!("cached token is {:?} and should be identical", tok);
Ok(())
});
let all = fut.join(fut2);
let mut rt = tokio::runtime::Runtime::new().unwrap();
rt.block_on(fut).unwrap()
rt.block_on(all).unwrap();
}