## 事象 ```rust error[E0382]: use of moved value: `db` --> src\main.rs:61:5 | 59 | let db = external::gtfsdb::GtfsDb::new(&op.database)?; | -- move occurs because `db` has type `GtfsDb`, which does not implement the `Copy` trait 60 | db.drop_all()?; | ---------- `db` moved due to this method call 61 | db.create_all()?; | ^^ value used here after move | note: this function consumes the receiver `self` by taking ownership of it, which moves `db` --> src\external\gtfs.rs:12:17 ``` ## 原因 メソッドの引数が`self`になっていたから。 ```rust fn create_all(self) -> Result<()> {} ``` これでは`create_all`が呼ばれたタイミングで所有権がmoveしてしまう。 ## 解決策 メソッドの引数を`&self`にする。 ```rust fn create_all(&self) -> Result<()> {} ``` `self: mut Self`の場合は`&mut self`。