Skip to content

Commit

Permalink
std: use new semantics for str type of the built-in append function
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Aug 24, 2024
1 parent 4f7f7ba commit e43b92a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions std/conv/ftoa.jule
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ fn genericFtoa(mut dst: []byte, val: f64, fmt: byte, mut prec: int, bitSize: int
// +inf, NaN
match {
| mant != 0:
ret append(dst, unsafe::StrBytes("nan")...)
ret append(dst, "nan"...)
| neg:
ret append(dst, unsafe::StrBytes("-inf")...)
ret append(dst, "-inf"...)
|:
ret append(dst, unsafe::StrBytes("+inf")...)
ret append(dst, "+inf"...)
}
| 0:
// denormalized
Expand Down
2 changes: 1 addition & 1 deletion std/internal/strings/builder.jule
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl StrBuilder {

// Writes bytes to buffer.
fn WriteStr(mut self, s: str) {
self.buf = append(self.buf, unsafe::StrBytes(s)...)
self.buf = append(self.buf, s...)
}

// Writes byte to buffer.
Expand Down
3 changes: 1 addition & 2 deletions std/jule/constant/lit/bytes.jule
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,5 @@ fn strEsqSeq(mut &buf: []byte, s: str, mut &i: int) {
buf = append(buf, byte(r))
ret
}
sr := str(r)
buf = append(buf, unsafe::StrBytes(sr)...)
buf = append(buf, str(r)...)
}

0 comments on commit e43b92a

Please sign in to comment.