Including Files and Deeply Directories in Rust

Written by josejaviasilis | Published 2020/03/26
Tech Story Tags: rust | import | modules | file | rs | includes | functional-programming | coding | web-monetization | hackernoon-es

TLDR Rust doesn't see files as files, but it sees them as modules and files inside folders as sub-modules. You can't just reference them directly with a simple import or drilled namespacing a la JavaScript or C# and use them right away. When using crate, you use the root directory to include everything. Rust can help Rust's compiler to identify it by providing a #path directive to use in our welcome code. Then we can reference it directly to call the run function directly.via the TL;DR App

no story

Written by josejaviasilis | Talks about: Web Development, Startup Engineering, and latest trends
Published by HackerNoon on 2020/03/26