1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

fix(cli): change seek offset type from i32 to i64 (#6518)

This commit is contained in:
Casper Beyer 2020-06-28 03:58:35 +08:00 committed by GitHub
parent f0093a9d8b
commit aeadf8189a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -151,7 +151,7 @@ fn op_open(
struct SeekArgs {
promise_id: Option<u64>,
rid: i32,
offset: i32,
offset: i64,
whence: i32,
}
@ -169,8 +169,8 @@ fn op_seek(
// Translate seek mode to Rust repr.
let seek_from = match whence {
0 => SeekFrom::Start(offset as u64),
1 => SeekFrom::Current(i64::from(offset)),
2 => SeekFrom::End(i64::from(offset)),
1 => SeekFrom::Current(offset),
2 => SeekFrom::End(offset),
_ => {
return Err(OpError::type_error(format!(
"Invalid seek mode: {}",