`String` is a complete substitute of the old `~str` (or `Box<str>` or
whatever) in such that `~str` should not be used now. Replace all
occurrence of `~str` with `String`, and `~"foo"` with
`"foo".to_string()`. Almost every function in the standard library,
including those in `std::str`, now returns `String` in place of
`~str`, so the remaining conversion is trivial.

2014-06-01 3:21 GMT+09:00 Christophe Pedretti <[email protected]>:
> Hi all,
>
> i have updated my rust compiler, i have several compilations errors on my
> project
>
> StrBuf does not exist any more, no problem, i now use String
> ~"" is obsolete, no problem, i use box ""
> The last isssue is " failed to find an implementation of trait
> core::cmp::TotalEq for ~str"
> util\properties.rs:12           self.props.find(key)
>                                 ^~~~~~~~~~~~~~~~~~~~
>
> My code is very simple and was compiling before
>
> ///Contains a list of properties. A property is a key-value pair.
> pub struct Properties {
> props : HashMap<~str, ~str>
> }
>
> impl Map<~str, ~str> for Properties {
> ///Get a property value giving its name. Return None if property does not
> exist.
> fn find<'a>(&'a self, key : &~str) -> Option<&'a ~str> {
> self.props.find(key)
> }
> ///Return true if a property value exists for the specified key
> fn contains_key(&self, key: &~str) -> bool {
> self.props.contains_key(key)
> }
> }
>
> what i am doing wrong ?
>
> Thanks
>
>
> _______________________________________________
> Rust-dev mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/rust-dev
>



-- 
-- Kang Seonghoon | Software Engineer, iPlateia Inc. | http://mearie.org/
-- Opinions expressed in this email do not necessarily represent the
views of my employer.
--
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to