forked from mirror/Riven
1
0
Fork 0

Update doctests

users/mingwei/surf v0.1.1
Mingwei Samuel 2019-11-07 16:38:53 -08:00
parent 120e703f45
commit a604b5f39e
4 changed files with 7 additions and 5 deletions

View File

@ -2,7 +2,7 @@ language: rust
matrix:
fast_finish: true
include:
- rust: beta
- rust: stable
- rust: nightly
env: FEATURES="--features nightly"
env:

View File

@ -16,6 +16,9 @@ travis-ci = { repository = "MingweiSamuel/Riven" }
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[package.metadata.docs.rs]
features = [ "nightly" ]
[features]
nightly = [ "parking_lot/nightly" ]

View File

@ -28,10 +28,9 @@ use riven::consts::Region;
// Riven Enter tokio async runtime.
let rt = tokio::runtime::Runtime::new().unwrap();
rt.block_on(async {
// Create RiotApi instance from key.
// Create RiotApi instance from key string.
let api_key = "RGAPI-01234567-89ab-cdef-0123-456789abcdef";
let api_key = std::env::var("RGAPI_KEY").ok()
.or_else(|| std::fs::read_to_string("apikey.txt").ok()).unwrap();
# /* (doc testing) */ let api_key = std::env!("RGAPI_KEY");
let riot_api = RiotApi::with_key(api_key);
// Get summoner data.

View File

@ -4,7 +4,7 @@
#![forbid(unsafe_code)]
#![cfg_attr(feature = "nightly", doc(include = "../README.md"))]
#![cfg_attr(not(feature = "nightly"), doc("See [README.md](https://github.com/MingweiSamuel/Riven#----riven--------------------)."))]
#![cfg_attr(not(feature = "nightly"), doc = "See [README.md](https://github.com/MingweiSamuel/Riven#readme).")]
mod config;
pub use config::RiotApiConfig;