Rename copy_file/2 to file_copy/2

This commit is contained in:
Adrián Arroyo Calle
2022-12-11 00:08:41 +01:00
parent c6aa2068e2
commit 5f703afed1
4 changed files with 16 additions and 13 deletions

View File

@@ -3533,12 +3533,12 @@ impl Machine {
self.rename_file();
step_or_fail!(self, self.machine_st.p = self.machine_st.cp);
}
&Instruction::CallCopyFile(_) => {
self.copy_file();
&Instruction::CallFileCopy(_) => {
self.file_copy();
step_or_fail!(self, self.machine_st.p += 1);
}
&Instruction::ExecuteCopyFile(_) => {
self.copy_file();
&Instruction::ExecuteFileCopy(_) => {
self.file_copy();
step_or_fail!(self, self.machine_st.p = self.machine_st.cp);
}
&Instruction::CallWorkingDirectory(_) => {

View File

@@ -1654,7 +1654,7 @@ impl Machine {
}
#[inline(always)]
pub(crate) fn copy_file(&mut self) {
pub(crate) fn file_copy(&mut self) {
if let Some(file) = self.machine_st.value_to_str_like(self.machine_st.registers[1]) {
if let Some(copied) = self.machine_st.value_to_str_like(self.machine_st.registers[2]) {
if fs::copy(file.as_str(), copied.as_str()).is_ok() {