ResultVal: Remove MoveFrom()

Replace it with std::move(result_val).Unwrap(), or Foo().Unwrap() in
case you already have an rvalue.
This commit is contained in:
Yuri Kunde Schlesner
2017-06-18 19:03:15 -07:00
parent 4cb47b0278
commit 723dc644fa
24 changed files with 53 additions and 57 deletions

View File

@ -311,7 +311,7 @@ ResultVal<std::shared_ptr<File>> OpenFileFromArchive(ArchiveHandle archive_handl
if (backend.Failed())
return backend.Code();
auto file = std::shared_ptr<File>(new File(backend.MoveFrom(), path));
auto file = std::shared_ptr<File>(new File(std::move(backend).Unwrap(), path));
return MakeResult<std::shared_ptr<File>>(std::move(file));
}
@ -401,7 +401,7 @@ ResultVal<std::shared_ptr<Directory>> OpenDirectoryFromArchive(ArchiveHandle arc
if (backend.Failed())
return backend.Code();
auto directory = std::shared_ptr<Directory>(new Directory(backend.MoveFrom(), path));
auto directory = std::shared_ptr<Directory>(new Directory(std::move(backend).Unwrap(), path));
return MakeResult<std::shared_ptr<Directory>>(std::move(directory));
}