Giter Club home page Giter Club logo

24daysofrust's Issues

day5 second exemple of basic request doesn't work as is

The correction with get_content don't compile on 1.8 Mac OS X.

cargo build
   Compiling timebotr v0.1.0 (file:///private/var/test/timebotr)
src/main.rs:16:20: 16:64 error: the trait `core::fmt::Display` is not implemented for the type `core::result::Result<collections::string::String, hyper::error::Error>` [E0277]
src/main.rs:16     println!("{}", get_content("http://httpbin.org/status/200"));
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<std macros>:2:25: 2:56 note: in this expansion of format_args!
<std macros>:3:1: 3:54 note: in this expansion of print! (defined in <std macros>)
src/main.rs:16:5: 16:66 note: in this expansion of println! (defined in <std macros>)
src/main.rs:16:20: 16:64 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:16:20: 16:64 note: `core::result::Result<collections::string::String, hyper::error::Error>` cannot be formatted with the default formatter; try using `:?` instead if you are using a format string
src/main.rs:16:20: 16:64 note: required by `core::fmt::Display::fmt`
error: aborting due to previous error
Could not compile `timebotr`.

Thank you!

I don't think any blog posts saved me so much time ever as "24 days of Rust". Big thank you!

Pozdrawiam!

FUSE: Consider using "auto_unmount" in fuse::mount

Hey, thanks for writing up these tutorials. I found that using the auto_unmount option with FUSE was a real timesaver in development, since it lets you ^c the program and then re-run it without running a separate fusermount -u <path> in between. It doesn't seem to be documented very well and this is probably the best introduction to the crate, so it might be nice to demonstrate its use in this book.

fuse::mount(JsonFilesystem, &mountpoint, &["-o,auto_unmount".as_ref()]);

Windows compatibility

We need to find out which examples don't run on Windows (FUSE for sure, need to see if something else) and possibly set up AppVeyor CI.

Day3 - CSV - Writer::from_file() deprecated

The method from_file() for Writer from BurntSushi's CSV crate has been deprecated a while ago and replaced by from_path(). As a relatively new person to Rust, this kind of got me stuck with the presented examples for writing into a CSV file until I dug into the documentation :).

Instead of:

let dollar_films = vec![
    ("A Fistful of Dollars", "Rojo", 1964),
    ("For a Few Dollars More", "El Indio", 1965),
    ("The Good, the Bad and the Ugly", "Tuco", 1966),
];
let path = "westerns.csv";
let mut writer = Writer::from_file(path).unwrap();
for row in dollar_films {
    writer.encode(row).expect("CSV writer error");
}

The following works just fine using the current version of CSV crate (1.1.1):

let dollar_films = vec![
    ["A Fistful of Dollars", "Rojo", "1964"],
    ["For a Few Dollars More", "El Indio", "1965"],
    ["The Good, the Bad and the Ugly", "Tuco", "1966"],
];
let path = "westerns.cvs";
let mut writer = Writer::from_path(path).unwrap();
for row in dollar_films {
    writer.write_record(&row).expect("CSV writer error");
    writer.flush();
}

Volume 1 Day 3 - That CSV does not have a standard is misleading

The package you mentioned already says that they implement https://tools.ietf.org/html/rfc4180. In that regard that wording is misleading:

Note that I said some variation - CSV itself isn't standardized and there are lots of quirks in different implementations.

That being said, I understand what you mean: there are many implementations which just don't follow the RFC and provide a naive implementation which does not handle delimeters or escape characters properly.

translations for Chinese

I really like this books, It is readable and interesting!

I'm a Chinese Student from ZJU, and I'd like to translate this into Chinese, during translation, I can learn rust language as well!

Is there any question or limitation? Can I do this?

Thanks very much!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.