Skip to content

Commit

Permalink
Review
Browse files Browse the repository at this point in the history
  • Loading branch information
leo60228 committed Aug 17, 2019
1 parent 5dacd2d commit ef3d8da
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,17 +217,14 @@ impl AutoCfg {
/// The test code is subject to change, but currently looks like:
///
/// ```ignore
/// extern crate CRATE as dummy; // `as _` wasn't stabilized until Rust 1.33
/// extern crate CRATE as probe; // `as _` wasn't stabilized until Rust 1.33
/// ```
pub fn probe_sysroot_crate(&self, name: &str) -> bool {
self.probe(format!("extern crate {} as dummy;", name))
self.probe(format!("extern crate {} as probe;", name))
.unwrap_or(false)
}

/// Emits a config value `has_PATH` if `probe_sysroot_crate` returns true.
///
/// Any non-identifier characters in the `path` will be replaced with
/// `_` in the generated config value.
/// Emits a config value `has_CRATE` if `probe_sysroot_crate` returns true.
pub fn emit_sysroot_crate(&self, name: &str) {
if self.probe_sysroot_crate(name) {
emit(&format!("has_{}", mangle(name)));
Expand Down

0 comments on commit ef3d8da

Please sign in to comment.