Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUST

rust import file

// in main.rs
mod hello;

fn main() {
    hello::print_hello();
}

// in hello.rs
pub fn print_hello() {
    println!("Hello, world!");
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #rust #import #file
ADD COMMENT
Topic
Name
4+8 =