We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This is an interesting crate, but why limit it to the stdin ? I was interested to use it on string. An why not files ?
The text was updated successfully, but these errors were encountered:
Maybe we can have a second argument for this, defaulting to stdin() so
stdin()
let stuff: String = read!("<b><i>{}</i></b>");
would be equivalent to
let stuff: String = read!("<b><i>{}</i></b>", stdin());
so that we could do
let stuff: String = read!("<b><i>{}</i></b>", html_input_string);
Sorry, something went wrong.
@sinistersnare agree
sorry, this issue must've gotten lost in my emails... That's a great Idea, I'll address it.
Doing files is hard... You usually want to continue reading in the file with a new read! call or similar... so right now it looks like
read!
use std::io::Read; let mut file = std::fs::File::open("tests/answer.txt").unwrap().bytes().map(|ch| ch.unwrap()); let val: i32 = read!("The answer is {}!!!11einself\n", file); assert_eq!(val, 42); let s: String = read!("There is {} spoon", file); assert_eq!(s, "no");
Which is quite a mouthful for reading from a file.
Until we get impl specialization, there's not much I can do except add a macro for turning a filename into a bytes iterator to the file.
oli-obk
No branches or pull requests
This is an interesting crate, but why limit it to the stdin ? I was interested to use it on string. An why not files ?
The text was updated successfully, but these errors were encountered: