
The Rust Feature Borrowing and Ownenship

Getting Started
Project
- name: hello-borrowing
- crate name: borrowing_exerci
- description: how to understand the rust borrowing
Subproject: bin-hello
- folder name: bin-hello
- description: the crate 'borrowing_exerci'
install the crate borrowing_exerci
bash
cargo install borrowing_exerci
Use the crate borrowing_exerci
help
bash
bw -h
List all commands with features for code
```bash
bw -c
example:
bw -c closureimmutstring
```
Run the code with a feature
- run a rust file with a feature
```bash
bw -c
-f | bat -l rs
example "closureimmutstring" with a feature "ok":
bw -c closureimmutstring -f ok | bat -l rs
tip: f
, Forward one window
tip: b
, Backward one window
tip: q
, Exit.
example "closureimmutstring" with a feature "err_01":
bw -c closureimmutstring -f err_01 | bat -l rs
tip: f
, Forward one window
tip: b
, Backward one window
tip: q
, Exit.
```
Resources