Change FileAccess wrapper functions to pass by value
This commit is contained in:
parent
1cc19d41da
commit
3a23f5feca
|
@ -36,7 +36,7 @@ pub const FileAccess = struct {
|
|||
/// Freeing an invalid `file_access` has no effect on the file and logs a warning over the
|
||||
/// wasted effort.
|
||||
///
|
||||
pub fn close(file_access: *FileAccess) void {
|
||||
pub fn close(file_access: FileAccess) void {
|
||||
return file_access.implementation.close(file_access.context);
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ pub const FileAccess = struct {
|
|||
/// Returns the number of bytes into the file that the cursor is relative to its beginning or a
|
||||
/// [Error] on failure.
|
||||
///
|
||||
pub fn queryCursor(file_access: *FileAccess) Error!u64 {
|
||||
pub fn queryCursor(file_access: FileAccess) Error!u64 {
|
||||
return file_access.implementation.queryCursor(file_access.context);
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@ pub const FileAccess = struct {
|
|||
/// Returns the current length of the file at the time of the operation or a [Error] if the file
|
||||
/// failed to be queried.
|
||||
///
|
||||
pub fn queryLength(file_access: *FileAccess) Error!u64 {
|
||||
pub fn queryLength(file_access: FileAccess) Error!u64 {
|
||||
return file_access.implementation.queryLength(file_access.context);
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ pub const FileAccess = struct {
|
|||
///
|
||||
/// Returns the number of bytes that were available to be read, otherwise an [Error] on failure.
|
||||
///
|
||||
pub fn read(file_access: *FileAccess, buffer: []u8) Error!usize {
|
||||
pub fn read(file_access: FileAccess, buffer: []u8) Error!usize {
|
||||
return file_access.implementation.read(file_access.context, buffer);
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,7 @@ pub const FileAccess = struct {
|
|||
///
|
||||
/// Returns [Error] on failure.
|
||||
///
|
||||
pub fn seek(file_access: *FileAccess, cursor: u64) Error!void {
|
||||
pub fn seek(file_access: FileAccess, cursor: u64) Error!void {
|
||||
return file_access.implementation.seek(file_access.context, cursor);
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,7 @@ pub const FileAccess = struct {
|
|||
///
|
||||
/// Returns [Error] on failure.
|
||||
///
|
||||
pub fn seekToEnd(file_access: *FileAccess) Error!void {
|
||||
pub fn seekToEnd(file_access: FileAccess) Error!void {
|
||||
return file_access.implementation.seekToEnd(file_access.context);
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,7 @@ pub const FileAccess = struct {
|
|||
///
|
||||
/// Returns [Error] on failure;
|
||||
///
|
||||
pub fn skip(file_access: *FileAccess, offset: i64) Error!void {
|
||||
pub fn skip(file_access: FileAccess, offset: i64) Error!void {
|
||||
return file_access.implementation.skip(file_access.context, offset);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue