slava-sh / rust-bundler

Creates a single-source-file version of a Cargo package
https://crates.io/crates/bundler
MIT License
21 stars 8 forks source link

New keyword in Rust 2018 not supported #6

Open NangiDev opened 3 years ago

NangiDev commented 3 years ago

When using lib-files withing same project the new syntax is

use crate::example

instead of

use {{crate_name}}::example

In my codingame template if trying to create a new lib and use inside math.rs with the crate_name::example it will fail when trying to bundle.

mariomka commented 3 years ago

The problem is when code is prettifyed.rustfmt crate is old and doesn't understand the new syntax. There is a new formatter rustfmt-nightly but it needs rust nightly...

NangiDev commented 3 years ago

Ah nice. I will see if I can try using the nightly one and see if that fixes my problem. Thanks!

mariomka commented 3 years ago

@NangiDev check #7 It should fix it.

NangiDev commented 3 years ago

Yes this works! Thanks! Hopefully it will be merged into crate. Now I have to build your repo manually.