From a604b5f39e4ebcd9175faf9d71c57a19524b663b Mon Sep 17 00:00:00 2001 From: Mingwei Samuel Date: Thu, 7 Nov 2019 16:38:53 -0800 Subject: [PATCH] Update doctests --- .travis.yml | 2 +- Cargo.toml | 3 +++ README.md | 5 ++--- src/lib.rs | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 67acc46..517be1e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: rust matrix: fast_finish: true include: - - rust: beta + - rust: stable - rust: nightly env: FEATURES="--features nightly" env: diff --git a/Cargo.toml b/Cargo.toml index 32c275a..a1c7c24 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" ] diff --git a/README.md b/README.md index eea5ffc..126c86b 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/src/lib.rs b/src/lib.rs index 4876c67..1133e9d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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;