refactor(3p/nix/libutil): Replace hasPrefix/Suffix with Abseil

Uses the equivalent absl::StartsWith and absl::EndsWith functions
instead.
This commit is contained in:
Vincent Ambo 2020-05-25 02:19:01 +01:00
parent 8cf1322a6f
commit b99b368d17
21 changed files with 69 additions and 57 deletions

View file

@ -2,6 +2,8 @@
#include <utility>
#include <absl/strings/match.h>
namespace nix {
SSHMaster::SSHMaster(const std::string& host, std::string keyFile,
@ -12,7 +14,7 @@ SSHMaster::SSHMaster(const std::string& host, std::string keyFile,
useMaster(useMaster && !fakeSSH),
compress(compress),
logFD(logFD) {
if (host.empty() || hasPrefix(host, "-")) {
if (host.empty() || absl::StartsWith(host, "-")) {
throw Error("invalid SSH host name '%s'", host);
}
}