mirror of
https://github.com/odin-lang/Odin.git
synced 2026-02-12 22:33:36 +00:00
Fix -vet for strings
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user