diff options
| author | gingerBill <bill@gingerbill.org> | 2020-05-24 17:57:55 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2020-05-24 17:57:55 +0100 |
| commit | a2c50d3666660304a46352905eee3bd90eb4ffe2 (patch) | |
| tree | 2ed354089d53d61dbda079860c492bde74249570 | |
| parent | f06efffe22136e204d85596da74bcb8c398a312d (diff) | |
Fix -vet for strings
| -rw-r--r-- | core/strings/strings.odin | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/core/strings/strings.odin b/core/strings/strings.odin index f89438c0a..49f15303b 100644 --- a/core/strings/strings.odin +++ b/core/strings/strings.odin @@ -773,7 +773,8 @@ string_case_iterator :: proc(b: ^Builder, s: string, callback: proc(b: ^Builder, to_lower_camel_case :: to_camel_case; to_camel_case :: proc(s: string, allocator := context.allocator) -> string { - s := trim_space(s); + s := s; + s = trim_space(s); b := make_builder(0, len(s), allocator); string_case_iterator(&b, s, proc(b: ^Builder, prev, curr, next: rune) { @@ -793,7 +794,8 @@ to_camel_case :: proc(s: string, allocator := context.allocator) -> string { to_upper_camel_case :: to_pascal_case; to_pascal_case :: proc(s: string, allocator := context.allocator) -> string { - s := trim_space(s); + s := s; + s = trim_space(s); b := make_builder(0, len(s), allocator); string_case_iterator(&b, s, proc(b: ^Builder, prev, curr, next: rune) { @@ -812,7 +814,8 @@ to_pascal_case :: proc(s: string, allocator := context.allocator) -> string { } to_delimiter_case :: proc(s: string, delimiter: rune, all_upper_case: bool, allocator := context.allocator) -> string { - s := trim_space(s); + s := s; + s = trim_space(s); b := make_builder(0, len(s), allocator); adjust_case := unicode.to_upper if all_upper_case else unicode.to_lower; @@ -868,7 +871,8 @@ to_upper_case :: proc(s: string, allocator := context.allocator) -> string { to_ada_case :: proc(s: string, allocator := context.allocator) -> string { delimiter :: '_'; - s := trim_space(s); + s := s; + s = trim_space(s); b := make_builder(0, len(s), allocator); prev, curr: rune; |