rust-by-practice/solutions/crate-module/use-pub.md

41 lines
609 B
Markdown
Raw Permalink Normal View History

2022-03-14 07:21:34 -06:00
1.
2022-05-01 00:08:50 -05:00
2022-03-14 07:21:34 -06:00
```rust
use std::fmt::Result;
use std::io::Result as IoResult;
fn main() {}
```
2.
2022-05-01 00:08:50 -05:00
2022-03-14 07:21:34 -06:00
```rust
use std::collections::*;
fn main() {
let _c1:HashMap<&str, i32> = HashMap::new();
let mut c2 = BTreeMap::new();
c2.insert(1, "a");
let _c3: HashSet<i32> = HashSet::new();
}
```
```rust
use std::collections::{HashMap, BTreeMap, HashSet};
fn main() {
let _c1:HashMap<&str, i32> = HashMap::new();
let mut c2 = BTreeMap::new();
c2.insert(1, "a");
let _c3: HashSet<i32> = HashSet::new();
}
```
2022-05-01 00:08:50 -05:00
3.
2022-03-14 07:21:34 -06:00
```rust
// in lib.rs
// Add this line
pub use crate::front_of_house::hosting;
```