diff --git a/Cargo.toml b/Cargo.toml index 2607e67..4eedd57 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "gcc" -version = "0.3.2" +version = "0.3.3" authors = ["Alex Crichton "] license = "MIT/Apache-2.0" repository = "https://github.com/alexcrichton/gcc-rs" diff --git a/src/lib.rs b/src/lib.rs index 481dd2f..460ca98 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -43,13 +43,13 @@ //! ``` #![doc(html_root_url = "http://alexcrichton.com/gcc-rs")] -#![feature(std_misc)] +#![feature(convert)] #![cfg_attr(test, deny(warnings))] use std::env; use std::fs; use std::io; -use std::path::{PathBuf, AsPath}; +use std::path::{PathBuf, Path}; use std::process::{Command, Stdio}; /// Extra configuration to pass to gcc. @@ -110,8 +110,8 @@ impl Config { } /// Add a directory to the `-I` or include path for headers - pub fn include(&mut self, dir: P) -> &mut Config { - self.include_directories.push(dir.as_path().to_path_buf()); + pub fn include>(&mut self, dir: P) -> &mut Config { + self.include_directories.push(dir.as_ref().to_path_buf()); self } @@ -122,8 +122,8 @@ impl Config { } /// Add an arbitrary object file to link in - pub fn object(&mut self, obj: P) -> &mut Config { - self.objects.push(obj.as_path().to_path_buf()); + pub fn object>(&mut self, obj: P) -> &mut Config { + self.objects.push(obj.as_ref().to_path_buf()); self } @@ -134,8 +134,8 @@ impl Config { } /// Add a file which will be compiled - pub fn file(&mut self, p: P) -> &mut Config { - self.files.push(p.as_path().to_path_buf()); + pub fn file>(&mut self, p: P) -> &mut Config { + self.files.push(p.as_ref().to_path_buf()); self } @@ -147,8 +147,8 @@ impl Config { assert!(output.ends_with(".a")); let target = getenv_unwrap("TARGET"); - let src = PathBuf::new(&getenv_unwrap("CARGO_MANIFEST_DIR")); - let dst = PathBuf::new(&getenv_unwrap("OUT_DIR")); + let src = PathBuf::from(getenv_unwrap("CARGO_MANIFEST_DIR")); + let dst = PathBuf::from(getenv_unwrap("OUT_DIR")); let mut objects = Vec::new(); for file in self.files.iter() { let mut cmd = self.gcc();