Skip to content

Commit

Permalink
Fix string decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
sidenaio committed Feb 7, 2023
1 parent 237a372 commit a6ad2a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bindgen/assembly/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ function decodeBytes<T>(buf: Uint8Array): Result<T> {
}
if (isString<T>()){
// @ts-ignore
return changetype<T>(util.bytesToString(buf));
return new Result(changetype<T>(util.bytesToString(buf)));
}

return Result.fail<T>(value);
Expand Down Expand Up @@ -675,7 +675,7 @@ class Result<T> {
}

static fail<T>(value : T) : Result<T> {
let r = new Result(value);
let r = new Result<T>(value);
r.success = false;
return r;
}
Expand Down

0 comments on commit a6ad2a8

Please sign in to comment.