diff options
author | Tom Cherry <tomcherry@google.com> | 2019-06-10 11:08:01 -0700 |
---|---|---|
committer | Tom Cherry <tomcherry@google.com> | 2019-06-10 12:39:18 -0700 |
commit | bbcbc2ffb339b2388e0cc282bb698fe436100b42 (patch) | |
tree | 3b1ab414d943a4a9b50dd29c581807fa2092ed06 /init/import_parser.cpp | |
parent | caa95d551d7f3b86d609b09bb4ab98e2435f6bc8 (diff) |
init: replace Result<Success> with Result<void>
Now that Result<T> is actually expected<T, ...>, and the expected
proposal states expected<void, ...> as the way to indicate an expected
object that returns either successfully with no object or an error,
let's move init's Result<Success> to the preferred Result<void>.
Bug: 132145659
Test: boot, init unit tests
Change-Id: Ib2f98396d8e6e274f95a496fcdfd8341f77585ee
Diffstat (limited to 'init/import_parser.cpp')
-rw-r--r-- | init/import_parser.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/init/import_parser.cpp b/init/import_parser.cpp index fb3185e83..c72b7d65e 100644 --- a/init/import_parser.cpp +++ b/init/import_parser.cpp @@ -23,8 +23,8 @@ namespace android { namespace init { -Result<Success> ImportParser::ParseSection(std::vector<std::string>&& args, - const std::string& filename, int line) { +Result<void> ImportParser::ParseSection(std::vector<std::string>&& args, + const std::string& filename, int line) { if (args.size() != 2) { return Error() << "single argument needed for import\n"; } @@ -38,10 +38,10 @@ Result<Success> ImportParser::ParseSection(std::vector<std::string>&& args, LOG(INFO) << "Added '" << conf_file << "' to import list"; if (filename_.empty()) filename_ = filename; imports_.emplace_back(std::move(conf_file), line); - return Success(); + return {}; } -Result<Success> ImportParser::ParseLineSection(std::vector<std::string>&&, int) { +Result<void> ImportParser::ParseLineSection(std::vector<std::string>&&, int) { return Error() << "Unexpected line found after import statement"; } |