From 366c388d3f4743362ec082d49184e881f0cae236 Mon Sep 17 00:00:00 2001 From: Arcterus Date: Tue, 6 May 2014 23:25:49 -0700 Subject: [PATCH] Update for latest Rust --- base64/base64.rs | 2 +- basename/basename.rs | 13 ++++++------- cat/cat.rs | 8 ++++---- cat/test.rs | 16 ++++++++-------- du/du.rs | 2 +- fold/fold.rs | 4 ++-- groups/groups.rs | 1 - kill/kill.rs | 4 ++-- md5sum/md5sum.rs | 3 ++- md5sum/rust-crypto | 2 +- mkdir/mkdir.rs | 19 ++++++++++--------- mkdir/test.rs | 4 ++-- paste/paste.rs | 6 +++--- rm/rm.rs | 4 ++-- seq/seq.rs | 2 +- seq/test.rs | 16 ++++++++-------- tac/tac.rs | 4 ++-- tee/tee.rs | 2 +- truncate/test.rs | 4 ++-- uname/uname.rs | 2 +- wc/wc.rs | 6 +++--- yes/yes.rs | 2 +- 22 files changed, 63 insertions(+), 63 deletions(-) diff --git a/base64/base64.rs b/base64/base64.rs index ad1d53e02..6e7c53524 100644 --- a/base64/base64.rs +++ b/base64/base64.rs @@ -161,7 +161,7 @@ fn help(progname: &str, usage: &str) { println!(""); println(usage); - let msg = ~"With no FILE, or when FILE is -, read standard input.\n\n\ + let msg = "With no FILE, or when FILE is -, read standard input.\n\n\ The data are encoded as described for the base64 alphabet in RFC \ 3548. When\ndecoding, the input may contain newlines in addition \ to the bytes of the formal\nbase64 alphabet. Use --ignore-garbage \ diff --git a/basename/basename.rs b/basename/basename.rs index 5a20e0dfa..99587bd1b 100644 --- a/basename/basename.rs +++ b/basename/basename.rs @@ -15,7 +15,6 @@ extern crate libc; use std::io::{print, println}; use std::os; -use std::str; use std::str::StrSlice; #[path = "../common/util.rs"] @@ -86,17 +85,17 @@ fn main() { println(name); } -fn strip_dir(fullname :&~str) -> ~str { - let mut name = ~""; +fn strip_dir(fullname: &~str) -> ~str { + let mut name = StrBuf::new(); - for c in fullname.chars_rev() { + for c in fullname.chars().rev() { if c == '/' || c == '\\' { - return name; + break; } - name = str::from_char(c) + name; + name.push_char(c); } - return fullname.clone(); + return name.as_slice().chars().rev().collect(); } fn strip_suffix(name: &~str, suffix: &~str) -> ~str { diff --git a/cat/cat.rs b/cat/cat.rs index c79472631..fa008b427 100644 --- a/cat/cat.rs +++ b/cat/cat.rs @@ -62,13 +62,13 @@ fn main() { if matches.opt_present("number-nonblank") { number_mode = NumberNonEmpty; } - let show_nonprint = matches.opts_present([~"show-nonprinting", ~"show-all", ~"t", ~"e"]); - let show_ends = matches.opts_present([~"show-ends", ~"show-all", ~"e"]); - let show_tabs = matches.opts_present([~"show-tabs", ~"show-all", ~"t"]); + let show_nonprint = matches.opts_present(["show-nonprinting".to_owned(), "show-all".to_owned(), "t".to_owned(), "e".to_owned()]); + let show_ends = matches.opts_present(["show-ends".to_owned(), "show-all".to_owned(), "e".to_owned()]); + let show_tabs = matches.opts_present(["show-tabs".to_owned(), "show-all".to_owned(), "t".to_owned()]); let squeeze_blank = matches.opt_present("squeeze-blank"); let mut files = matches.free; if files.is_empty() { - files = vec!(~"-"); + files = vec!("-".to_owned()); } exec(files, number_mode, show_nonprint, show_ends, show_tabs, squeeze_blank); diff --git a/cat/test.rs b/cat/test.rs index fc469b526..9a8a60a72 100644 --- a/cat/test.rs +++ b/cat/test.rs @@ -1,32 +1,32 @@ -use std::io::process::{Process, ProcessConfig}; +use std::io::process::Process; use std::str; #[test] fn test_output_multi_files_print_all_chars() { let prog = Process::output("build/cat", - [~"cat/fixtures/alpha.txt", ~"cat/fixtures/256.txt", - ~"-A", ~"-n"]).unwrap(); + ["cat/fixtures/alpha.txt".to_owned(), "cat/fixtures/256.txt".to_owned(), + "-A".to_owned(), "-n".to_owned()]).unwrap(); let out = str::from_utf8_owned(prog.output.as_slice().to_owned()).unwrap(); assert_eq!(out, - ~" 1\tabcde$\n 2\tfghij$\n 3\tklmno$\n 4\tpqrst$\n 5\tuvwxyz$\n 6\t^@^A^B^C^D^E^F^G^H^I$\n 7\t^K^L^M^N^O^P^Q^R^S^T^U^V^W^X^Y^Z^[^\\^]^^^_ !\"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~^?M-^@M-^AM-^BM-^CM-^DM-^EM-^FM-^GM-^HM-^IM-^JM-^KM-^LM-^MM-^NM-^OM-^PM-^QM-^RM-^SM-^TM-^UM-^VM-^WM-^XM-^YM-^ZM-^[M-^\\M-^]M-^^M-^_M- M-!M-\"M-#M-$M-%M-&M-\'M-(M-)M-*M-+M-,M--M-.M-/M-0M-1M-2M-3M-4M-5M-6M-7M-8M-9M-:M-;M-M-?M-@M-AM-BM-CM-DM-EM-FM-GM-HM-IM-JM-KM-LM-MM-NM-OM-PM-QM-RM-SM-TM-UM-VM-WM-XM-YM-ZM-[M-\\M-]M-^M-_M-`M-aM-bM-cM-dM-eM-fM-gM-hM-iM-jM-kM-lM-mM-nM-oM-pM-qM-rM-sM-tM-uM-vM-wM-xM-yM-zM-{M-|M-}M-~M-^?"); + " 1\tabcde$\n 2\tfghij$\n 3\tklmno$\n 4\tpqrst$\n 5\tuvwxyz$\n 6\t^@^A^B^C^D^E^F^G^H^I$\n 7\t^K^L^M^N^O^P^Q^R^S^T^U^V^W^X^Y^Z^[^\\^]^^^_ !\"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~^?M-^@M-^AM-^BM-^CM-^DM-^EM-^FM-^GM-^HM-^IM-^JM-^KM-^LM-^MM-^NM-^OM-^PM-^QM-^RM-^SM-^TM-^UM-^VM-^WM-^XM-^YM-^ZM-^[M-^\\M-^]M-^^M-^_M- M-!M-\"M-#M-$M-%M-&M-\'M-(M-)M-*M-+M-,M--M-.M-/M-0M-1M-2M-3M-4M-5M-6M-7M-8M-9M-:M-;M-M-?M-@M-AM-BM-CM-DM-EM-FM-GM-HM-IM-JM-KM-LM-MM-NM-OM-PM-QM-RM-SM-TM-UM-VM-WM-XM-YM-ZM-[M-\\M-]M-^M-_M-`M-aM-bM-cM-dM-eM-fM-gM-hM-iM-jM-kM-lM-mM-nM-oM-pM-qM-rM-sM-tM-uM-vM-wM-xM-yM-zM-{M-|M-}M-~M-^?".to_owned()); } #[test] fn test_stdin_squeeze() { - let mut prog = Process::new("build/cat", [~"-A"]).unwrap(); + let mut prog = Process::new("build/cat", ["-A".to_owned()]).unwrap(); prog.stdin.take_unwrap().write(bytes!("\x00\x01\x02")); let out = str::from_utf8_owned(prog.wait_with_output().output.as_slice().to_owned()).unwrap(); - assert_eq!(out, ~"^@^A^B"); + assert_eq!(out, "^@^A^B".to_owned()); } #[test] fn test_stdin_number_non_blank() { - let mut prog = Process::new("build/cat", [~"-b", ~"-"]).unwrap(); + let mut prog = Process::new("build/cat", ["-b".to_owned(), "-".to_owned()]).unwrap(); prog.stdin.take_unwrap().write(bytes!("\na\nb\n\n\nc")); let out = str::from_utf8_owned(prog.wait_with_output().output.as_slice().to_owned()).unwrap(); - assert_eq!(out, ~"\n 1\ta\n 2\tb\n\n\n 3\tc"); + assert_eq!(out, "\n 1\ta\n 2\tb\n\n\n 3\tc".to_owned()); } diff --git a/du/du.rs b/du/du.rs index 57d195830..a586b00c8 100644 --- a/du/du.rs +++ b/du/du.rs @@ -212,7 +212,7 @@ ers of 1000).", separate_dirs: matches.opt_present("S"), }; - let strs = if matches.free.is_empty() {vec!(~"./")} else {matches.free.clone()}; + let strs = if matches.free.is_empty() {vec!("./".to_owned())} else {matches.free.clone()}; let options_arc = Arc::new(options); diff --git a/fold/fold.rs b/fold/fold.rs index 2d8ef5c88..baccc32da 100644 --- a/fold/fold.rs +++ b/fold/fold.rs @@ -166,10 +166,10 @@ fn fold_file(file: BufferedReader, bytes: bool, spaces: bool, let ncount = routput.chars().fold(0, |out, ch: char| out + if ch == '\t' { 8 } else { 1 }); (slice.slice_to(m + 1), routput, ncount) }, - None => (slice, ~"", 0) + None => (slice, "".to_owned(), 0) } } else { - (slice, ~"", 0) + (slice, "".to_owned(), 0) }; println!("{}", out); (val, ncount) diff --git a/groups/groups.rs b/groups/groups.rs index 0de403920..d46ac19d1 100644 --- a/groups/groups.rs +++ b/groups/groups.rs @@ -11,7 +11,6 @@ #![feature(macro_rules)] extern crate getopts; -//extern crate libc; use std::os; use getopts::{ diff --git a/kill/kill.rs b/kill/kill.rs index 2a9309eb6..189f29985 100644 --- a/kill/kill.rs +++ b/kill/kill.rs @@ -89,7 +89,7 @@ fn main() { }; match mode { - Kill => kill(matches.opt_str("signal").unwrap_or(~"9"), matches.free), + Kill => kill(matches.opt_str("signal").unwrap_or("9".to_owned()), matches.free), Table => table(), List => list(matches.opt_str("list")), Help => help(NAME, usage), @@ -166,7 +166,7 @@ fn help(progname: &str, usage: &str) { } fn signal_by_name_or_value(signal_name_or_value:~str) -> Option { - if signal_name_or_value == ~"0"{ + if signal_name_or_value == "0".to_owned() { return Some(0); } for signal in ALL_SIGNALS.iter() { diff --git a/md5sum/md5sum.rs b/md5sum/md5sum.rs index 1b4e1294c..117eb00ef 100644 --- a/md5sum/md5sum.rs +++ b/md5sum/md5sum.rs @@ -13,6 +13,7 @@ extern crate crypto = "rust-crypto"; extern crate getopts; +extern crate libc; use std::io::fs::File; use std::io::BufferedReader; @@ -134,7 +135,7 @@ fn md5sum(files: Vec<~str>, binary: bool, check: bool, tag: bool, status: bool, fn calc_sum(md5: &mut crypto::md5::Md5, file: &mut File, binary: bool) -> ~str { let data = if binary { - safe_unwrap!(file.read_to_end()) + (safe_unwrap!(file.read_to_end())).as_slice().to_owned() } else { (safe_unwrap!(file.read_to_str())).into_bytes() }; diff --git a/md5sum/rust-crypto b/md5sum/rust-crypto index fd168c53c..c5d40913e 160000 --- a/md5sum/rust-crypto +++ b/md5sum/rust-crypto @@ -1 +1 @@ -Subproject commit fd168c53c00475c4fae3efc329301e80451bd967 +Subproject commit c5d40913eabdd51c226c06c274e7dd8dcc49d2fe diff --git a/mkdir/mkdir.rs b/mkdir/mkdir.rs index 55651f382..4ae6b79c0 100644 --- a/mkdir/mkdir.rs +++ b/mkdir/mkdir.rs @@ -16,6 +16,7 @@ extern crate libc; use std::os; use std::io::fs; +use std::io::FilePermission; use std::num::strconv; #[path = "../common/util.rs"] @@ -62,19 +63,19 @@ fn main() { // Translate a ~str in octal form to u32, default to 755 // Not tested on Windows - let mode_match = matches.opts_str(&[~"mode"]); - let mode: u32 = if mode_match.is_some() { + let mode_match = matches.opts_str(&["mode".to_owned()]); + let mode: FilePermission = if mode_match.is_some() { let m = mode_match.unwrap(); - let res = strconv::from_str_common(m, 8, false, false, false, - strconv::ExpNone, - false, false); + let res: Option = strconv::from_str_common(m, 8, false, false, false, + strconv::ExpNone, + false, false); if res.is_some() { - res.unwrap() + unsafe { std::cast::transmute(res.unwrap()) } } else { crash!(1, "no mode given"); } } else { - 0o755 + unsafe { std::cast::transmute(0o755 as u32) } }; let dirs = matches.free; @@ -92,7 +93,7 @@ fn print_help(opts: &[getopts::OptGroup]) { /** * Create the list of new directories */ -fn exec(dirs: Vec<~str>, mk_parents: bool, mode: u32, verbose: bool) { +fn exec(dirs: Vec<~str>, mk_parents: bool, mode: FilePermission, verbose: bool) { let mut parent_dirs = Vec::new(); if mk_parents { for dir in dirs.iter() { @@ -141,7 +142,7 @@ fn exec(dirs: Vec<~str>, mk_parents: bool, mode: u32, verbose: bool) { /** * Wrapper to catch errors, return false if failed */ -fn mkdir(path: &Path, mode: u32) { +fn mkdir(path: &Path, mode: FilePermission) { match fs::mkdir(path, mode) { Ok(_) => {}, Err(e) => { diff --git a/mkdir/test.rs b/mkdir/test.rs index d35f08edd..4c6009062 100644 --- a/mkdir/test.rs +++ b/mkdir/test.rs @@ -43,7 +43,7 @@ fn test_mkdir_dup_dir() { #[test] fn test_mkdir_mode() { cleanup(test_dir3); - let prog = Process::status(exe.into_owned(), [~"-m", ~"755", test_dir3.into_owned()]); + let prog = Process::status(exe.into_owned(), ["-m".to_owned(), "755".to_owned(), test_dir3.into_owned()]); let exit_success = prog.unwrap().success(); cleanup(test_dir3); assert_eq!(exit_success, true); @@ -52,7 +52,7 @@ fn test_mkdir_mode() { #[test] fn test_mkdir_parent() { cleanup(test_dir4); - let prog = Process::status(exe.into_owned(), [~"-p", test_dir4.into_owned()]); + let prog = Process::status(exe.into_owned(), ["-p".to_owned(), test_dir4.into_owned()]); let exit_success = prog.unwrap().success(); cleanup(test_dir4); assert_eq!(exit_success, true); diff --git a/paste/paste.rs b/paste/paste.rs index ce46892ef..78949fbf2 100644 --- a/paste/paste.rs +++ b/paste/paste.rs @@ -50,7 +50,7 @@ fn main() { let serial = matches.opt_present("serial"); let delimiters = match matches.opt_str("delimiters") { Some(m) => m, - None => ~"\t" + None => "\t".to_owned() }; paste(matches.free, serial, delimiters); } @@ -64,7 +64,7 @@ fn paste(filenames: Vec<~str>, serial: bool, delimiters: ~str) { let mut delim_count = 0; if serial { for file in files.mut_iter() { - let mut output = ~""; + let mut output = "".to_owned(); loop { output = output + match file.read_line() { Ok(line) => line.trim_right() + delimiters[delim_count % delimiters.len()], @@ -81,7 +81,7 @@ fn paste(filenames: Vec<~str>, serial: bool, delimiters: ~str) { } else { let mut eof = Vec::from_elem(files.len(), false); loop { - let mut output = ~""; + let mut output = "".to_owned(); let mut eof_count = 0; for (i, file) in files.mut_iter().enumerate() { if *eof.get(i) { diff --git a/rm/rm.rs b/rm/rm.rs index e8e193786..3ffc19b09 100644 --- a/rm/rm.rs +++ b/rm/rm.rs @@ -125,7 +125,7 @@ fn remove(files: Vec<~str>, force: bool, interactive: InteractiveMode, one_fs: b let file = Path::new(filename.to_owned()); if file.exists() { if file.is_dir() { - if recursive && (*filename != ~"/" || !preserve_root) { + if recursive && (*filename != "/".to_owned() || !preserve_root) { let walk_dir = match fs::walk_dir(&file) { Ok(m) => m, Err(f) => { @@ -134,7 +134,7 @@ fn remove(files: Vec<~str>, force: bool, interactive: InteractiveMode, one_fs: b }; remove(walk_dir.map(|x| x.as_str().unwrap().to_owned()).collect(), force, interactive, one_fs, preserve_root, recursive, dir, verbose); remove_dir(&file, *filename, interactive, verbose); - } else if dir && (*filename != ~"/" || !preserve_root) { + } else if dir && (*filename != "/".to_owned() || !preserve_root) { remove_dir(&file, *filename, interactive, verbose); } else { if recursive { diff --git a/seq/seq.rs b/seq/seq.rs index 210d55451..c079c4e0b 100644 --- a/seq/seq.rs +++ b/seq/seq.rs @@ -83,7 +83,7 @@ fn main() { Ok(n) => n, Err(s) => { show_error!(1, "{:s}", s); return; } }; - let separator = escape_sequences(matches.opt_str("s").unwrap_or(~"\n")); + let separator = escape_sequences(matches.opt_str("s").unwrap_or("\n".to_owned())); let terminator = escape_sequences(matches.opt_str("t").unwrap_or(separator.clone())); print_seq(first, step, last, separator, terminator, matches.opt_present("w")); } diff --git a/seq/test.rs b/seq/test.rs index a0f0f8f70..3e4f77cbf 100644 --- a/seq/test.rs +++ b/seq/test.rs @@ -3,28 +3,28 @@ use std::str; #[test] fn test_count_up() { - let p = Process::output("build/seq", [~"10"]).unwrap(); + let p = Process::output("build/seq", ["10".to_owned()]).unwrap(); let out = str::from_utf8(p.output.as_slice().to_owned()).unwrap().into_owned(); - assert_eq!(out, ~"1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n"); + assert_eq!(out, "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n".to_owned()); } #[test] fn test_count_down() { - let p = Process::output("build/seq", [~"--", ~"5", ~"-1", ~"1"]).unwrap(); + let p = Process::output("build/seq", ["--".to_owned(), "5".to_owned(), "-1".to_owned(), "1".to_owned()]).unwrap(); let out = str::from_utf8(p.output.as_slice().to_owned()).unwrap().into_owned(); - assert_eq!(out, ~"5\n4\n3\n2\n1\n"); + assert_eq!(out, "5\n4\n3\n2\n1\n".to_owned()); } #[test] fn test_separator_and_terminator() { - let p = Process::output("build/seq", [~"-s", ~",", ~"-t", ~"!", ~"2", ~"6"]).unwrap(); + let p = Process::output("build/seq", ["-s".to_owned(), ",".to_owned(), "-t".to_owned(), "!".to_owned(), "2".to_owned(), "6".to_owned()]).unwrap(); let out = str::from_utf8(p.output.as_slice().to_owned()).unwrap().into_owned(); - assert_eq!(out, ~"2,3,4,5,6!"); + assert_eq!(out, "2,3,4,5,6!".to_owned()); } #[test] fn test_equalize_widths() { - let p = Process::output("build/seq", [~"-w", ~"5", ~"10"]).unwrap(); + let p = Process::output("build/seq", ["-w".to_owned(), "5".to_owned(), "10".to_owned()]).unwrap(); let out = str::from_utf8(p.output.as_slice().to_owned()).unwrap().into_owned(); - assert_eq!(out, ~"05\n06\n07\n08\n09\n10\n"); + assert_eq!(out, "05\n06\n07\n08\n09\n10\n".to_owned()); } diff --git a/tac/tac.rs b/tac/tac.rs index e8e4f0179..6cfc63696 100644 --- a/tac/tac.rs +++ b/tac/tac.rs @@ -58,7 +58,7 @@ fn main() { m } } - None => ~"\n" + None => "\n".to_owned() }; tac(matches.free, before, regex, separator); } @@ -77,7 +77,7 @@ fn tac(filenames: Vec<~str>, before: bool, _: bool, separator: ~str) { data = buf.into_owned(); } let split_vec: ~[&str] = data.split_str(separator).collect(); - let rev: ~str = split_vec.rev_iter().fold(~"", |a, &b| + let rev: ~str = split_vec.iter().rev().fold("".to_owned(), |a, &b| a + if before { separator + b } else { diff --git a/tee/tee.rs b/tee/tee.rs index e3b566f02..a580fc89f 100644 --- a/tee/tee.rs +++ b/tee/tee.rs @@ -57,7 +57,7 @@ fn options(args: &[~str]) -> Result { let help = format!("{}\n\nUsage:\n {} {}\n\n{}\n{}", version, program, arguments, usage(brief, opts), comment); - let names = m.free.clone().move_iter().collect::>().append_one(~"-").as_slice().to_owned(); + let names = m.free.clone().move_iter().collect::>().append_one("-".to_owned()).as_slice().to_owned(); let to_print = if m.opt_present("help") { Some(help) } else if m.opt_present("version") { Some(version) } else { None }; diff --git a/truncate/test.rs b/truncate/test.rs index d9e0da25e..01777822b 100644 --- a/truncate/test.rs +++ b/truncate/test.rs @@ -15,7 +15,7 @@ fn make_file(name: &str) -> io::File { #[test] fn test_increase_file_size() { let mut file = make_file(TFILE1); - if !Process::status(PROG, [~"-s", ~"+5K", TFILE1.to_owned()]).unwrap().success() { + if !Process::status(PROG, ["-s".to_owned(), "+5K".to_owned(), TFILE1.to_owned()]).unwrap().success() { fail!(); } file.seek(0, io::SeekEnd); @@ -29,7 +29,7 @@ fn test_increase_file_size() { fn test_decrease_file_size() { let mut file = make_file(TFILE2); file.write(bytes!("1234567890")); - if !Process::status(PROG, [~"--size=-4", TFILE2.to_owned()]).unwrap().success() { + if !Process::status(PROG, ["--size=-4".to_owned(), TFILE2.to_owned()]).unwrap().success() { fail!(); } file.seek(0, io::SeekEnd); diff --git a/uname/uname.rs b/uname/uname.rs index baec8625a..aaefedc1e 100644 --- a/uname/uname.rs +++ b/uname/uname.rs @@ -80,7 +80,7 @@ fn main() { let uname = unsafe { getuname() }; let mut output = StrBuf::new(); if matches.opt_present("sysname") || matches.opt_present("all") - || !matches.opts_present([~"nodename", ~"release", ~"version", ~"machine"]) { + || !matches.opts_present(["nodename".to_owned(), "release".to_owned(), "version".to_owned(), "machine".to_owned()]) { output.push_str(uname.sysname); output.push_str(" "); } diff --git a/wc/wc.rs b/wc/wc.rs index 503867ca2..057509905 100644 --- a/wc/wc.rs +++ b/wc/wc.rs @@ -70,7 +70,7 @@ fn main() { let mut files = matches.free.clone(); if files.is_empty() { - files = vec!(~"-"); + files = vec!("-".to_owned()); } wc(files, &matches); @@ -181,7 +181,7 @@ pub fn wc(files: Vec<~str>, matches: &Matches) { } if files.len() > 1 { - print_stats(&~"total", total_line_count, total_word_count, total_char_count, total_byte_count, total_longest_line_length, matches, max_str_len); + print_stats(&"total".to_owned(), total_line_count, total_word_count, total_char_count, total_byte_count, total_longest_line_length, matches, max_str_len); } } @@ -214,7 +214,7 @@ fn print_stats(filename: &~str, line_count: uint, word_count: uint, char_count: print!("{:1$}", byte_count, max_str_len + 1); } - if *filename != ~"-" { + if *filename != "-".to_owned() { println!(" {}", *filename); } else { diff --git a/yes/yes.rs b/yes/yes.rs index 45b0cd253..47bde021a 100644 --- a/yes/yes.rs +++ b/yes/yes.rs @@ -50,7 +50,7 @@ fn main() { println!("yes 1.0.0"); return; } - let mut string = ~"y"; + let mut string = "y".to_owned(); if !matches.free.is_empty() { string = matches.free.connect(" "); }