danielpclark / faster_path

Faster Pathname handling for Ruby written in Rust
MIT License
781 stars 29 forks source link

Replace use of include! with modules #37

Closed jdm closed 8 years ago

jdm commented 8 years ago

Instead of including each file's contents inside lib.rs using include!, it is more idiomatic to use Rust's modules instead. That would look like:

pub use a::some_function;
pub use b::some_other_function;

mod a;
mod b;

rather than

include!("a.rs")
include!("b.rs")
Antti commented 8 years ago

I never seen such usage of include!. Seems very hacky. Somewhat resembles C's #include

steveklabnik commented 8 years ago

Big :+1: . I also believe that you won't get incremental compilation with this approach, but modules will let you.

danielpclark commented 8 years ago

Did not know that @steveklabnik . I used includes because it was the least hastle to get going. But if some one would be willing to reformat it into modules I'd be willing to go that way. :+1:

steveklabnik commented 8 years ago

To be clear, we don't have incremental recompilation yet, but when we do, this will matter :smile: