News for hackers. Stuff that matters.
Re:Rust: Not So Great For Codec Implementing by Manishearth on Tuesday August 01, 2017 @01:26PM (#14903133)
> is it kind of similar to Go where any file can simply import

You declare your crate dependencies in a Cargo.toml file. Rust does proper versioning of dependencies so having a separate manifest is desirable. Within your code you declare the existence of a crate via `extern crate` and then you can use it wherever.

> the compiler force you to remove the imports too

it warns.

Re:Rust: Not So Great For Codec Implementing by greenhouse_gas on Tuesday August 01, 2017 @03:14PM (#14904304)
Do you know if there are plans for rustfmt to auto-import like gofmt does? In the sense that if a crate is available (in the .toml file) and you reference it, rustfmt will automatically insert the required "import" and "use".
Re:Rust: Not So Great For Codec Implementing by killercup on Tuesday August 01, 2017 @03:42PM (#14904577)
If the compiler gives you an error with a suggestion "You probably need to add `extern crate foo;`" (and it already does in some cases), RLS (i.e., your editor plugin) will be able to automatically add it for you (soon™).
Re:Rust: Not So Great For Codec Implementing by steveklabnik on Tuesday August 01, 2017 @03:18PM (#14904340)
There's been talk of it, but it hasn't been built yet.

It's more likely to be a part of RLS than rustfmt.

Re:Rust: Not So Great For Codec Implementing by Manishearth on Tuesday August 01, 2017 @05:31PM (#14905566)
This would probably be an RLS thing.

There's a separate tool called rustfix in development that can apply the suggestions given by the compiler, so it could theoretically prompt for these.