hello, I dont understand why I get an error:
#[macro_use] extern crate text_io;
let i: i32;
let a: i32;
scan!("{}", i);
scan!("{}", a);
but works separated with curved brackets:
scan!("{}", i);
{
scan!("{}", a);
}
??
hello, I dont understand why I get an error:
#[macro_use] extern crate text_io;
let i: i32;
let a: i32;
scan!("{}", i);
scan!("{}", a);
but works separated with curved brackets:
scan!("{}", i);
{
scan!("{}", a);
}
??
Hello @p53. Can you please elaborate:
thanks for response; that is the complete code (inside a main function)
All I care about is the principle why you can not do several simple scan without this weird error message.
let a: i32;
let b: i32;
scan!("{}", a);
scan!("{}", b);
/*
25 | scan!("{}", a);
| --------------- previous import of the trait `Read` here
26 | scan!("{}", b);
| ^^^^^^^^^^^^^^^ `Read` reimported here
= note: `Read` must be defined only once in the type namespace of this block
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
help: You can use `as` to change the binding name of the import
2 | use :: std :: io :: Read as OtherRead ; scan ! (
*/
Looks like a bug in that macro definition. File an issue in that crate’s github repo.