Skip to content

Commit ecbcdb7

Browse files
committed
add comment to readme and lib.rs example
1 parent 7fc82b2 commit ecbcdb7

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ use twitch_api::twitch_oauth2::{AccessToken, UserToken};
2222

2323
#[tokio::main]
2424
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
25-
25+
// Create the HelixClient, which is used to make requests to the Twitch API
2626
let client: HelixClient<reqwest::Client> = HelixClient::default();
27-
27+
// Create a UserToken, which is used to authenticate requests
2828
let token = UserToken::from_token(&client, AccessToken::from("mytoken")).await?;
2929

3030
println!(

examples/eventsub/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ pub async fn run(opts: &Opts) -> eyre::Result<()> {
6767
.wrap_err_with(|| "when creating client")?,
6868
);
6969

70-
// Get the access token
70+
// Get the app access token
7171
let token = twitch_oauth2::AppAccessToken::get_app_access_token(
7272
&client,
7373
opts.client_id.clone(),

src/lib.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,13 @@
1919
//! ```rust,no_run
2020
//! use twitch_api::helix::HelixClient;
2121
//! use twitch_api::twitch_oauth2::{AccessToken, UserToken};
22-
//! pub type BoxedStdError = Box<dyn std::error::Error + Send + Sync + 'static>;
2322
//!
2423
//! #[tokio::main]
25-
//! async fn main() -> Result<(), BoxedStdError> {
24+
//! async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
25+
//! // Create the HelixClient, which is used to make requests to the Twitch API
2626
//! let client: HelixClient<reqwest::Client> = HelixClient::default();
27-
//!
28-
//! let token =
29-
//! UserToken::from_token(&client, AccessToken::from("mytoken"))
30-
//! .await?;
27+
//! // Create a UserToken, which is used to authenticate requests.
28+
//! let token = UserToken::from_token(&client, AccessToken::from("mytoken")).await?;
3129
//!
3230
//! println!(
3331
//! "Channel: {:?}",
@@ -45,10 +43,9 @@
4543
//! tokens::errors::AppAccessTokenError, AppAccessToken, TwitchToken,
4644
//! };
4745
//! use twitch_api::{helix::channels::GetChannelInformationRequest, TwitchClient};
48-
//! pub type BoxedStdError = Box<dyn std::error::Error + Send + Sync + 'static>;
4946
//!
5047
//! #[tokio::main]
51-
//! async fn main() -> Result<(), BoxedStdError> {
48+
//! async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
5249
//! let client: TwitchClient<reqwest::Client> = TwitchClient::default();
5350
//! let token = AppAccessToken::get_app_access_token(
5451
//! &client,

0 commit comments

Comments
 (0)