News for hackers. Stuff that matters.
Re:Learning Rust – Day 4 – Understanding Modules by ibraheemdev on Thursday May 12, 2022 @10:49AM (#31355027)
The most common confusion with this is that when importing library code from your binary, you use `crate_name::...` as opposed to `crate::...`, as they are separate. You also don't have to declare the lib.rs as a module from the binary, and generally all your `mod` statements will reside in your lib.rs
Re:Learning Rust – Day 4 – Understanding Modules by faitswulff on Thursday May 12, 2022 @11:01PM (#31362797)
Hey, your comment made me realize I'm an idiot and I was trying to make a lib folder at the sibling level to the src folder. That plus your tip about how to organize the files and everything makes sense now. Thanks!