Skip to content

Commit

Permalink
update some doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Tropix126 committed Dec 17, 2023
1 parent cd4df91 commit 20f5a6c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description = "Wrapper for the RobotEvents.com v2 API."
repository = "https://github.com/LemLib/robotevents-rs/"
license-file = "LICENSE.md"
readme = "README.md"
version = "0.1.0"
version = "0.2.0"
edition = "2021"
authors=["tropix126", "BattleCh1cken"]
categories = ["science::robotics", "api-bindings", "web-programming::http-client"]
Expand Down
10 changes: 6 additions & 4 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,19 @@ pub const V1_API_BASE: &str = "https://www.robotevents.com/api/v1";
pub const V2_API_BASE: &str = "https://www.robotevents.com/api/v2";

impl RobotEvents {
/// Create a new RobotEvents API client.
///
/// A bearer authentication token is required for requests to be made. This can
/// be obtained from RobotEvents by creating an account and requesting one.
pub fn new(bearer_token: impl AsRef<str>) -> Self {
Self {
bearer_token: bearer_token.as_ref().to_owned(),
req_client: reqwest::Client::new(),
}
}

/// Make a request to a [RobotEvents API v2](https://www.robotevents.com/api/v2) endpoint.
///
/// Requires a bearer authentication token to be provided for requests to work. This can
/// be obtained from RobotEvents by creating an account and requesting one.
/// Make a request to a [RobotEvents API v2](https://www.robotevents.com/api/v2) endpoint using the
/// client's bearer token.
pub async fn request(
&self,
endpoint: impl AsRef<str>,
Expand Down
2 changes: 1 addition & 1 deletion src/schema/season.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ impl Season {
.json()
.await?)
}
}
}

0 comments on commit 20f5a6c

Please sign in to comment.