zsiciarz / 24daysofrust Goto Github PK
View Code? Open in Web Editor NEWCode examples accompanying my "24 days of Rust" article series.
Home Page: https://zsiciarz.github.io/24daysofrust/
License: MIT License
Code examples accompanying my "24 days of Rust" article series.
Home Page: https://zsiciarz.github.io/24daysofrust/
License: MIT License
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()]);
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.
I don't think any blog posts saved me so much time ever as "24 days of Rust". Big thank you!
Pozdrawiam!
In the second (i.e. non-empty) implementation of getattr
, the result is:
reply.error(ENOSYS);
but it should be:
reply.error(ENOENT);
We want a 'File not found' rather than a 'Function not implemented' message.
bo brakuje dobrych stron o ruscie
I'm learning rust. would you update? 😭
None of the links work at: https://zsiciarz.github.io/24daysofrust//
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!
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`.
Could you add a section for R in day 23? Thanks!
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.
Tracked in the serde-0.9
branch.
Waiting for softprops/envy#6.
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();
}
It may be worth switching now that serde
is so popular. See json!
.
Following Huon's migration - let's use https://github.com/huonw/primal instead of slow_primes.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.