Skip to content

Commit

Permalink
std: fix dependation cycle
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Aug 13, 2024
1 parent 5e8f6f5 commit 11abad5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions std/jule/integrated/conv.jule
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD 3-Clause
// license that can be found in the LICENSE file.

use fastbytes for std::internal::fastbytes
use utf16 for std::unicode::utf16

// Builtin:
Expand Down Expand Up @@ -92,11 +91,12 @@ unsafe fn BytePtrToStr(s: *byte): str {
// NULL terminated string pointer. If s contatins NULL termination at any location,
// accepts NULL termination is the end of s and skips following bytes.
fn StrToBytes(s: str): []byte {
mut i := fastbytes::FindByteStr(s, 0)
if i != -1 {
mut bytes := make([]byte, i+1)
copy(bytes, s[:len(bytes)])
ret bytes
for i, b in s {
if b == 0 {
mut bytes := make([]byte, i+1)
copy(bytes, s[:len(bytes)])
ret bytes
}
}
mut bytes := make([]byte, len(s)+1)
copy(bytes, s)
Expand Down

0 comments on commit 11abad5

Please sign in to comment.