builtin: add @[direct_array_access] to js string trim_right method (#20222)

This commit is contained in:
Turiiya 2023-12-19 22:31:30 +01:00 committed by GitHub
parent 93756d2027
commit 4bab3e700e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -285,6 +285,7 @@ pub fn (s string) u8() u64 {
// trim_right strips any of the characters given in `cutset` from the right of the string.
// Example: assert ' Hello V d'.trim_right(' d') == ' Hello V'
@[direct_array_access]
pub fn (s string) trim_right(cutset string) string {
if s.len < 1 || cutset.len < 1 {
return s.clone()