Skip to content

Commit

Permalink
fixed another error
Browse files Browse the repository at this point in the history
  • Loading branch information
JakubSzark committed Aug 26, 2021
1 parent 59b5cdb commit 6678e7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zig-string.zig
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ pub const String = struct {

/// Returns an owned slice of this string
pub fn toOwned(self: String) Error!?[]u8 {
if (self.buffer) {
if (self.buffer != null) {
const string = self.str();
if (self.allocator.alloc(u8, string.len)) |newStr| {
std.mem.copy(u8, newStr, string);
Expand Down

0 comments on commit 6678e7a

Please sign in to comment.