diff --git a/.gitignore b/.gitignore index 61ae5aa..3623806 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ Cargo.lock # MSVC Windows builds of rustc generate these, which store debugging information *.pdb +*.backup \ No newline at end of file diff --git a/README.md b/README.md index fb982fb..ab2bf4d 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,21 @@ # playerdb-rs -[playerdb](https://playerdb.co/) client with support for async/sync. \ No newline at end of file +[playerdb](https://playerdb.co/) client with support for async/sync. + +## Examples + +### Async (using Tokio) + +```Rust +let api = playerdb_rs::PlayerDBApi::default(); +let result = api.get_minecraft_player("notch").await; +dbg!(result); +``` + +### Sync + +```Rust +let api = playerdb_rs::sync::PlayerDBApi::default(); +let result = api.get_minecraft_player("notch"); +dbg!(result); +``` diff --git a/examples/minecraft-async/src/main.rs b/examples/minecraft-async/src/main.rs index d77fe19..b67d4ee 100644 --- a/examples/minecraft-async/src/main.rs +++ b/examples/minecraft-async/src/main.rs @@ -4,7 +4,7 @@ use playerdb_rs::PlayerDBApi; async fn main() -> anyhow::Result<()> { let api = PlayerDBApi::default(); - let res = api.get_minecraft_player("wyndftw").await?; + let res = api.get_minecraft_player("notch").await?; print!("{:#?}", res); diff --git a/examples/minecraft-sync/src/main.rs b/examples/minecraft-sync/src/main.rs index 36ee9ed..2ba0f01 100644 --- a/examples/minecraft-sync/src/main.rs +++ b/examples/minecraft-sync/src/main.rs @@ -3,7 +3,7 @@ use playerdb_rs::sync::PlayerDBApi; fn main() { let api = PlayerDBApi::default(); - let res = api.get_minecraft_player("wyndftw"); + let res = api.get_minecraft_player("notch"); match res { Ok(x) => println!("{:#?}", x),