refactor(3p/nix/libutil): Replace chomp() with absl::strings
This commit is contained in:
parent
10481d2586
commit
06d7b4aebd
15 changed files with 40 additions and 26 deletions
5
third_party/nix/src/libutil/util.cc
vendored
5
third_party/nix/src/libutil/util.cc
vendored
|
|
@ -1210,11 +1210,6 @@ string concatStringsSep(const string& sep, const StringSet& ss) {
|
|||
return s;
|
||||
}
|
||||
|
||||
string chomp(const string& s) {
|
||||
size_t i = s.find_last_not_of(" \n\r\t");
|
||||
return i == string::npos ? "" : string(s, 0, i + 1);
|
||||
}
|
||||
|
||||
string trim(const string& s, const string& whitespace) {
|
||||
auto i = s.find_first_not_of(whitespace);
|
||||
if (i == string::npos) {
|
||||
|
|
|
|||
3
third_party/nix/src/libutil/util.hh
vendored
3
third_party/nix/src/libutil/util.hh
vendored
|
|
@ -324,9 +324,6 @@ MakeError(Interrupted, BaseError)
|
|||
string concatStringsSep(const string& sep, const Strings& ss);
|
||||
string concatStringsSep(const string& sep, const StringSet& ss);
|
||||
|
||||
/* Remove trailing whitespace from a string. */
|
||||
string chomp(const string& s);
|
||||
|
||||
/* Remove whitespace from the start and end of a string. */
|
||||
string trim(const string& s, const string& whitespace = " \n\r\t");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue