From 416838c8ab5fa9ad2280805b3eb2c00aad62d06b Mon Sep 17 00:00:00 2001 From: Jack Moffitt Date: Sun, 1 Jun 2014 00:08:34 -0600 Subject: [PATCH] Upgrade Rust. --- alert.rc | 2 +- linux.rs | 5 ++--- macos.rs | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/alert.rc b/alert.rc index 2894c5d..099004d 100644 --- a/alert.rc +++ b/alert.rc @@ -42,6 +42,6 @@ pub trait AlertMethods { /// Runs the alert modally. fn run(&self); /// Returns the value of the prompt. - fn prompt_value(&self) -> ~str; + fn prompt_value(&self) -> String; } diff --git a/linux.rs b/linux.rs index 54c64b0..b167165 100644 --- a/linux.rs +++ b/linux.rs @@ -13,7 +13,7 @@ use std::io::BufferedReader; /// An alert. pub struct Alert { - url: ~str, + url: String, } impl AlertMethods for Alert { @@ -27,14 +27,13 @@ impl AlertMethods for Alert { self.url = match BufferedReader::new(io::stdin()).read_line() { Ok(res) => res, _ => fail!("Could not read URL from stdin"), - } } fn run(&self) { } - fn prompt_value(&self) -> ~str { + fn prompt_value(&self) -> String { self.url.clone() } } diff --git a/macos.rs b/macos.rs index dc35091..71be734 100644 --- a/macos.rs +++ b/macos.rs @@ -12,7 +12,7 @@ use AlertMethods; use cocoa::appkit::{NSPoint, NSRect, NSSize}; use cocoa::base::{objc_getClass, sel_registerName}; use cocoa::base; -use std::cast::{transmute, transmute_copy}; +use std::mem::{transmute, transmute_copy}; use std::from_str::FromStr; use core_foundation::base::TCFType; use core_foundation::string::CFString; @@ -87,7 +87,7 @@ impl AlertMethods for Alert { } } - fn prompt_value(&self) -> ~str { + fn prompt_value(&self) -> String { unsafe { // [nstextfield stringValue] let selector = sel_registerName(transmute(&"stringValue"[0]));