Would it be worth introducing an own!() macro for this purpose? I came across this suggestion on the reddit thread: http://www.reddit.com/r/rust/comments/2340zb/rustdev_removing_foo/
-- Ziad On Tue, Apr 15, 2014 at 10:12 AM, Patrick Walton <[email protected]>wrote: > Hi everyone, > > I'd like to remove the `~"foo"` literal syntax for owned strings in both > expressions and patterns. After dynamically sized types, this syntax is the > last remnant of the strange parser behavior by which the parser does > something different for `~"foo"` and `~("foo")` (i.e. by which it looks at > the next token when it sees a sigil and does something different than it > would otherwise). > > The new replacement for `~"foo"` will be `"foo".to_owned()`. You can also > use the `fmt!()` macro or the `.to_str()` function. Post-DST, you will > likely also be able to write `Heap::from("foo")`. > > This has no effect on constants since `~"foo"` is not allowed there anyway. > > Patrick > _______________________________________________ > Rust-dev mailing list > [email protected] > https://mail.mozilla.org/listinfo/rust-dev >
_______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
