mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-26 19:32:06 -05:00
BindingsGenerator: Pass optional values as 'sv' to String::from_utf8()
Pass optional values as StringView to String::from_utf8(), otherwise this would not compile.
This commit is contained in:
parent
be727ea871
commit
98ef76b144
1 changed files with 1 additions and 1 deletions
|
@ -343,7 +343,7 @@ static void generate_to_new_string(SourceGenerator& scoped_generator, ParameterT
|
|||
})~~~");
|
||||
if (optional_default_value.has_value() && (!parameter.type->is_nullable() || optional_default_value.value() != "null")) {
|
||||
scoped_generator.append(R"~~~( else {
|
||||
@cpp_name@ = TRY_OR_THROW_OOM(vm, String::from_utf8(@parameter.optional_default_value@));
|
||||
@cpp_name@ = TRY_OR_THROW_OOM(vm, String::from_utf8(@parameter.optional_default_value@sv));
|
||||
}
|
||||
)~~~");
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue