From 4d815b8ec9e695c5af0267252a8754b9c5a5d6cb Mon Sep 17 00:00:00 2001 From: edef Date: Wed, 14 Jan 2015 11:15:52 +0100 Subject: [PATCH] clean up warnings in the build script --- build.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build.rs b/build.rs index f3c4ce3..a77eea6 100644 --- a/build.rs +++ b/build.rs @@ -1,3 +1,4 @@ +#![allow(unstable)] use std::io::Command; use std::io::fs::PathExtensions; use std::io::fs; @@ -18,7 +19,7 @@ fn main() { if let Some(basename) = eat_extension(filename, ".c") { outpath = format!("{}/{}.o", out_dir, basename); - Command::new("cc").args(&[filepath.as_slice(), "-c", "-fPIC", "-o"]) + Command::new("cc").args(&[&*filepath, "-c", "-fPIC", "-o"]) .arg(outpath.clone()) .status().unwrap(); } @@ -38,7 +39,7 @@ fn main() { fn eat_extension<'a>(s: &'a str, ext: &str) -> Option<&'a str> { if s.ends_with(ext) { - Some(s.slice_to(s.len() - ext.len())) + Some(&s[..s.len() - ext.len()]) } else { None