Skip to content

Commit

Permalink
Merge pull request #304 from kukimik/patch-1
Browse files Browse the repository at this point in the history
Minor docfixes in read_bytes! and read_utf8!
  • Loading branch information
lukewilliamboswell authored Jan 5, 2025
2 parents 82e0e76 + 6bea43e commit 2b8b01d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions platform/File.roc
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ delete! = \path ->
##
## This opens the file first and closes it after reading its contents.
##
## > To read and decode data from a file, you can use `File.read` instead.
## > To read and decode data from a file into a [Str], you can use [File.read_utf8!] instead.
## >
## > [Path.read_bytes!] does the same thing, except it takes a [Path] instead of a [Str].
read_bytes! : Str => Result (List U8) [FileReadErr Path IOErr]
Expand All @@ -146,7 +146,7 @@ read_bytes! = \path ->
## File.read_utf8! "myfile.txt"
## ```
##
## This opens the file first and closes it after writing to it.
## This opens the file first and closes it after reading its contents.
## The task will fail with `FileReadUtf8Err` if the given file contains invalid UTF-8.
##
## > To read unformatted bytes from a file, you can use [File.read_bytes!] instead.
Expand Down
4 changes: 2 additions & 2 deletions platform/Path.roc
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ delete! = \path ->
## Path.read_utf8 (Path.from_str "myfile.txt")
## ```
##
## This opens the file first and closes it after writing to it.
## This opens the file first and closes it after reading its contents.
## The task will fail with `FileReadUtf8Err` if the given file contains invalid UTF-8.
##
## > To read unformatted bytes from a file, you can use [Path.read_bytes!] instead.
Expand All @@ -318,7 +318,7 @@ read_utf8! = \path ->
##
## This opens the file first and closes it after reading its contents.
##
## > To read and decode data from a file, you can use `Path.read` instead.
## > To read and decode data from a file into a [Str], you can use [Path.read_utf8!] instead.
## >
## > [`File.read_bytes`](File#read_bytes!) does the same thing, except it takes a [Str] instead of a [Path].
read_bytes! : Path => Result (List U8) [FileReadErr Path IOErr]
Expand Down

0 comments on commit 2b8b01d

Please sign in to comment.