completion 0.2.1

Utilities for writing completion-based asynchronous code
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::process::Command;

fn main() {
    let rustc = std::env::var_os("RUSTC").unwrap_or_else(|| "rustc".into());

    let is_nightly = Some(())
        .and_then(|()| Command::new(&rustc).arg("--version").output().ok())
        .and_then(|output| String::from_utf8(output.stdout).ok())
        .map_or(false, |stdout| stdout.contains("nightly"));

    if is_nightly {
        println!("cargo:rustc-cfg=doc_cfg");
    }
}