ごらくらいふ

プログラミングしたりゲームしたり

2018-01-06から1日間の記事一覧

列挙型で error[E0507]: cannot move out of borrowed content に対処した

ムーブセマンティクスを忘れていた話。 Builderパターンで以下のように書いたところコンパイラにerror[E0507]: cannot move out of borrowed contentと怒られた。 enum Method { Get, Post, } struct Client { method: Method, } struct ClientBuilder { met…