Skip to content

Commit 3e06455

Browse files
committed
Swift: delete TargetFile's move assignment
1 parent d748cb4 commit 3e06455

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

swift/extractor/infra/TargetFile.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,6 @@ std::optional<TargetFile> TargetFile::create(std::string_view target,
6767
return std::nullopt;
6868
}
6969

70-
TargetFile& TargetFile::operator=(TargetFile&& other) {
71-
if (this != &other) {
72-
commit();
73-
workingPath = std::move(other.workingPath);
74-
targetPath = std::move(other.targetPath);
75-
out = std::move(other.out);
76-
}
77-
return *this;
78-
}
79-
8070
void TargetFile::commit() {
8171
if (out.is_open()) {
8272
out.close();

swift/extractor/infra/TargetFile.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ class TargetFile {
2424
~TargetFile() { commit(); }
2525

2626
TargetFile(TargetFile&& other) = default;
27-
TargetFile& operator=(TargetFile&& other);
27+
// move assignment deleted as non-trivial and not needed
28+
TargetFile& operator=(TargetFile&& other) = delete;
2829

2930
template <typename T>
3031
TargetFile& operator<<(T&& value) {

0 commit comments

Comments
 (0)