Marked String(string_view) explicit

Change-Id: I56cc7477860a76059f60e78c658622a8daa65441
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/416699
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This commit is contained in:
Ethan Nicholas 2021-06-08 10:23:51 -04:00 committed by Skia Commit-Bot
parent 0d1e2ca1e6
commit eaa9e07e1c
2 changed files with 2 additions and 2 deletions

View File

@ -78,7 +78,7 @@ public:
explicit String(std::string s) : INHERITED(std::move(s)) {}
String(StringFragment s) : INHERITED(s.fChars, s.fLength) {}
String(skstd::string_view s) : INHERITED(s.data(), s.length()) {}
explicit String(skstd::string_view s) : INHERITED(s.data(), s.length()) {}
// TODO(johnstiles): add operator skstd::string_view
static String printf(const char* fmt, ...) SK_PRINTF_LIKE(1, 2);

View File

@ -200,7 +200,7 @@ DSLType Struct(skstd::string_view name, SkTArray<DSLField> fields) {
skslFields.emplace_back(field.fModifiers.fModifiers, field.fName, &field.fType.skslType());
}
const SkSL::Type* result = DSLWriter::SymbolTable()->add(Type::MakeStructType(/*offset=*/-1,
name,
String(name),
skslFields));
DSLWriter::ProgramElements().push_back(std::make_unique<SkSL::StructDefinition>(/*offset=*/-1,
*result));