1
0
mirror of https://github.com/rust-lang/rustlings.git synced 2025-06-19 00:17:42 +02:00
Files
.github
dev
exercises
00_intro
01_variables
02_functions
03_if
04_primitive_types
05_vecs
06_move_semantics
07_structs
08_enums
09_strings
10_modules
README.md
modules1.rs
modules2.rs
modules3.rs
11_hashmaps
12_options
13_error_handling
14_generics
15_traits
16_lifetimes
17_tests
18_iterators
19_smart_pointers
20_threads
21_macros
22_clippy
23_conversions
quizzes
README.md
rustlings-macros
solutions
src
tests
.editorconfig
.gitignore
.markdownlint.yml
.typos.toml
CHANGELOG.md
CONTRIBUTING.md
Cargo.lock
Cargo.toml
LICENSE
README.md
oranda.json
release-hook.sh
rustlings/exercises/10_modules/modules1.rs

16 lines
300 B
Rust
Raw Normal View History

mod sausage_factory {
// Don't let anybody outside of this module see this!
fn get_secret_recipe() -> String {
String::from("Ginger")
}
fn make_sausage() {
get_secret_recipe();
println!("sausage!");
}
}
fn main() {
sausage_factory::make_sausage();
}