update repo layout

This commit is contained in:
sunface
2022-03-23 20:04:00 +08:00
parent e2d3027b60
commit c1d8b06518
111 changed files with 958 additions and 4 deletions

View File

@@ -0,0 +1,29 @@
# Borrowing
1. 🌟🌟
```rust,editable
// FIX the error without removing any code line
struct test {
list: Vec<i32>,
a: i32
}
impl test {
pub fn new() -> Self {
test { list:vec![1,2,3,4,5,6,7], a:0 }
}
pub fn run(&mut self) {
for i in self.list.iter() {
self.do_something(*i)
}
}
pub fn do_something(&mut self, n: i32) {
self.a = n;
}
}
fn main() {}
```