rust-si
rust-si copied to clipboard
a rusty `scanf` (`scan!`) and inverse of `print!` (`read!`)
This is my attempt at implementing #28
``` let data = String::from("1-5 w:dsjvly wge"); let min: i32; let max: i32; let c: char; let pw: String; scan!(data.bytes() => "{}-{} {}:{}", min, max, c, pw); dbg!(pw); ``` Here,...
The following two macro variants seem to be more of an implementation detail than a part of the public API ```rust (@question_mark: $($e:tt)+) => { ... }; (@unwrap: $($e:tt)+) =>...
It would be very convenient to have `try_scan!(@impl or_none, ...)` to use in functions that return Option. The current solutions only provide unwrapping and returning Result.
`read!("{}\n")` works on Windows, but the resulting string still has a nasty `\r` on the end. It would be nice to have a `read_line!` that stops on either on `\r`...
I'm running into an issue when using serde_json's Result in the same program as text_io's read!() macro. Here's an example: ``` #[macro_use] extern crate text_io; use std::io; use std::io::Write; use...
Would it not make more sense for `scan!` or `read!` to read from an object of type `Read` or `BufRead` rather than `Iterator`?
Or I can't find it. Is `read!` the only macro? How do I use existing string without reading from input?
This is an interesting crate, but why limit it to the stdin ? I was interested to use it on string. An why not files ?
`read!("{}, {}")` should read `"x , y"` by skipping all whitespace