I'm trying to learn Rust by doing a project I call "iron-santa" (
https://github.com/brycefisher/iron-santa) that parses RSS feeds from
Craigslist. I work on both a 64 bit Ubuntu 12.04 machine and a MacBook Pro
OS 10.8, and I have the latest nightlies installed on both machines. I'm
running into what appear to be cross-platform compatibility issues. Here is
code that compiles on my OSX machine:

struct CLZone {
  lat: f64,
  long: f64,
  name: ~str,
  url: ~str
}

fn get_clzones() -> ~[CLZone] {
    ~[
      CLZone{lat:37.79511, long:-122.397235, name:"San Francisco Bay
Area".to_owned(), url:"sfbay".to_owned()}
    ]
}

However, this same code fails on my Ubuntu machine with this error:

"error: mismatched types: expected `~str` but found `std::strbuf::StrBuf`
(expected box but found struct std::strbuf::StrBuf)
src/iron-santa.rs:21       CLZone{lat:37.79511, long:-122.397235, name:"San
Francisco Bay Area".to_owned(), url:"sfbay".to_owned()}"

I assumed that string types from the std library would be cross platform
compatibility. Is my assumption wrong or did I make some other mistake?
Thanks!!
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to