Skip to content

Commit

Permalink
docs(readme): update README and activate rusty-hook
Browse files Browse the repository at this point in the history
- Updated the README with detailed usage instructions and project information.
- Activated rusty-hook for pre-commit checks and validations.
  • Loading branch information
AndrielFR committed Jan 3, 2025
1 parent 713b36f commit b47f726
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ chrono = "*"
reqwest = "*"
thiserror = "2"
serde_json = "1"

[dev-dependencies]
rusty-hook = "*"
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,48 @@

Just an [Anilist](https://anilist.co/) API wrapper made in Rust.

## Features

- Basic functionality to interact with the Anilist API.
- Asynchronous methods to load full details of entities like Anime, Manga, User, Person, and Character.
- Comprehensive data models with detailed documentation.

## Current status

It's working, just the basics, but it already works.

## Installation

Add the following to your `Cargo.toml`:

```toml
[dependencies]
rust-anilist = "*"
```

## Usage

Here's a basic example of how to use the library:

```rust
use rust_anilist::Client;

#[tokio::main]
async fn main() {
let client = Client::with_token("your_api_key");
let anime = client.get_anime(1).await.unwrap();
println!("{:?}", anime);
}
```

## Documentation

The library is fully documented. You can find the documentation [here](https://docs.rs/rust-anilist).

## License

Copyright © 2022-2025 [AndrielFR](https://github.com/AndrielFR)

Licensed under the [Expat/MIT license](LICENSE).
This project is also [REUSE compliant](https://reuse.software/).
See individual files for more copyright information.
a.rs
4 changes: 2 additions & 2 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl Client {
/// # Arguments
///
/// * `token` - A string slice that holds the API token.
pub fn with_api_token(token: &str) -> Self {
pub fn with_token(token: &str) -> Self {
Self {
api_token: Some(token.to_string()),
timeout: 20,
Expand Down Expand Up @@ -76,7 +76,7 @@ impl Client {
/// # Arguments
///
/// * `token` - A string slice that holds the API token.
pub fn api_token(mut self, token: &str) -> Self {
pub fn token(mut self, token: &str) -> Self {
self.api_token = Some(token.to_string());
self
}
Expand Down

0 comments on commit b47f726

Please sign in to comment.