Eliminate some warnings

This commit is contained in:
Brian Anderson 2012-10-08 17:18:07 -07:00
parent 134632bb45
commit e8ee1be88e
4 changed files with 11 additions and 10 deletions

View file

@ -12,7 +12,7 @@ pub enum RenderMode {
}
#[allow(non_implicitly_copyable_typarams)]
pub fn from_cmdline_args(args: ~[~str]) -> Opts {
pub fn from_cmdline_args(args: &[~str]) -> Opts {
use std::getopts;
let args = args.tail();

View file

@ -12,12 +12,13 @@ use util::url::make_url;
use pipes::{Port, Chan};
fn main(args: ~[~str]) {
run(opts::from_cmdline_args(args))
fn main() {
let args = os::args();
run(&opts::from_cmdline_args(args))
}
#[allow(non_implicitly_copyable_typarams)]
fn run(opts: Opts) {
fn run(opts: &Opts) {
match opts.render_mode {
Screen => run_pipeline_screen(opts.urls),
Png(outfile) => {
@ -30,7 +31,7 @@ fn run(opts: Opts) {
}
}
fn run_pipeline_screen(urls: ~[~str]) {
fn run_pipeline_screen(urls: &[~str]) {
// The platform event handler thread
let osmain = OSMain();
@ -66,7 +67,7 @@ fn run_pipeline_screen(urls: ~[~str]) {
osmain.send(osmain::Exit);
}
fn run_pipeline_png(-url: ~str, outfile: ~str) {
fn run_pipeline_png(+url: ~str, outfile: &str) {
// Use a PNG encoder as the graphics compositor
use gfx::png_compositor;
use png_compositor::PngCompositor;

View file

@ -1,7 +1,7 @@
// Timing functions.
use std::time::precise_time_ns;
pub fn time(msg: ~str, callback: fn()) {
pub fn time(msg: &str, callback: fn()) {
let start_time = precise_time_ns();
callback();
let end_time = precise_time_ns();

View file

@ -15,7 +15,7 @@ Create a URL object from a string. Does various helpful browsery things like
*/
#[allow(non_implicitly_copyable_typarams)]
fn make_url(str_url: ~str, current_url: Option<Url>) -> Url {
fn make_url(+str_url: ~str, +current_url: Option<Url>) -> Url {
let mut schm = url::get_scheme(str_url);
let str_url = if result::is_err(&schm) {
if current_url.is_none() {
@ -30,13 +30,13 @@ fn make_url(str_url: ~str, current_url: Option<Url>) -> Url {
} else {
let path = str::split_char(current_url.path, '/');
let path = path.init();
let path = str::connect(path + ~[copy str_url], "/");
let path = str::connect(path + ~[str_url], "/");
current_url.scheme + "://" + current_url.host + path
}
}
} else {
copy str_url
str_url
};
// FIXME: Need to handle errors