Skip to content

Commit 12e504c

Browse files
author
梶塚太智
committed
リファクタリング:エラー処理を追加
1 parent 8b84d16 commit 12e504c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,9 @@ impl Executor {
924924
"rename" => {
925925
let to = self.pop_stack().get_string();
926926
let from = self.pop_stack().get_string();
927-
let _result = fs::rename(from, to);
927+
if let Err(e) = fs::rename(from, to) {
928+
self.log_print(format!("エラー! {e}\n"))
929+
}
928930
}
929931

930932
// ファイル一覧のリスト

0 commit comments

Comments
 (0)