diff --git a/compiler/can/src/builtins.rs b/compiler/can/src/builtins.rs index bd127dfe04..d6187d3d40 100644 --- a/compiler/can/src/builtins.rs +++ b/compiler/can/src/builtins.rs @@ -1484,7 +1484,10 @@ fn str_from_utf8_range(symbol: Symbol, var_store: &mut VarStore) -> Def { loc_pattern: no_region(Pattern::Identifier(Symbol::ARG_3)), loc_expr: no_region(RunLowLevel { op: LowLevel::StrFromUtf8Range, - args: vec![(bytes_var, Var(Symbol::ARG_1)), (arg_record_var, Var(Symbol::ARG_2))], + args: vec![ + (bytes_var, Var(Symbol::ARG_1)), + (arg_record_var, Var(Symbol::ARG_2)), + ], ret_var: ll_record_var, }), expr_var: ll_record_var, @@ -1560,7 +1563,6 @@ fn str_from_utf8_range(symbol: Symbol, var_store: &mut VarStore) -> Def { ret_var, ) } - /// Str.toUtf8 : Str -> List U8 fn str_to_utf8(symbol: Symbol, var_store: &mut VarStore) -> Def { diff --git a/compiler/gen_llvm/src/llvm/build_str.rs b/compiler/gen_llvm/src/llvm/build_str.rs index e86343ac84..9d3c482f9d 100644 --- a/compiler/gen_llvm/src/llvm/build_str.rs +++ b/compiler/gen_llvm/src/llvm/build_str.rs @@ -306,8 +306,6 @@ pub fn str_from_utf8_range<'a, 'ctx, 'env>( builder.build_load(result_ptr_cast, "load_utf8_validate_bytes_result") } - - /// Str.fromUtf8 : List U8 -> { a : Bool, b : Str, c : Nat, d : I8 } pub fn str_from_utf8<'a, 'ctx, 'env>( env: &Env<'a, 'ctx, 'env>, diff --git a/compiler/module/src/low_level.rs b/compiler/module/src/low_level.rs index 3c7b189f72..d360192d8c 100644 --- a/compiler/module/src/low_level.rs +++ b/compiler/module/src/low_level.rs @@ -111,12 +111,12 @@ impl LowLevel { match self { StrConcat | StrJoinWith | StrIsEmpty | StrStartsWith | StrStartsWithCodePt - | StrEndsWith | StrSplit | StrCountGraphemes | StrFromInt | StrFromUtf8 | StrFromUtf8Range | StrToUtf8 - | StrFromFloat | ListLen | ListGetUnsafe | ListSet | ListDrop | ListSingle - | ListRepeat | ListReverse | ListConcat | ListContains | ListAppend | ListPrepend - | ListJoin | ListRange | ListSwap | DictSize | DictEmpty | DictInsert | DictRemove - | DictContains | DictGetUnsafe | DictKeys | DictValues | DictUnion - | DictIntersection | DictDifference | SetFromList | NumAdd | NumAddWrap + | StrEndsWith | StrSplit | StrCountGraphemes | StrFromInt | StrFromUtf8 + | StrFromUtf8Range | StrToUtf8 | StrFromFloat | ListLen | ListGetUnsafe | ListSet + | ListDrop | ListSingle | ListRepeat | ListReverse | ListConcat | ListContains + | ListAppend | ListPrepend | ListJoin | ListRange | ListSwap | DictSize | DictEmpty + | DictInsert | DictRemove | DictContains | DictGetUnsafe | DictKeys | DictValues + | DictUnion | DictIntersection | DictDifference | SetFromList | NumAdd | NumAddWrap | NumAddChecked | NumSub | NumSubWrap | NumSubChecked | NumMul | NumMulWrap | NumMulChecked | NumGt | NumGte | NumLt | NumLte | NumCompare | NumDivUnchecked | NumRemUnchecked | NumIsMultipleOf | NumAbs | NumNeg | NumSin | NumCos diff --git a/compiler/test_gen/src/gen_str.rs b/compiler/test_gen/src/gen_str.rs index 6e7ce971f0..0db480cf1d 100644 --- a/compiler/test_gen/src/gen_str.rs +++ b/compiler/test_gen/src/gen_str.rs @@ -866,7 +866,7 @@ fn str_from_utf8_range_slice() { #[test] fn str_from_utf8_range_slice_not_end() { assert_evals_to!( - indoc!( + indoc!( r#" bytes = Str.toUtf8 "hello" when Str.fromUtf8Range bytes { count: 3, start: 1 } is @@ -882,7 +882,7 @@ fn str_from_utf8_range_slice_not_end() { #[test] fn str_from_utf8_range_order_does_not_matter() { assert_evals_to!( - indoc!( + indoc!( r#" bytes = Str.toUtf8 "hello" when Str.fromUtf8Range bytes { start: 1, count: 3 } is