Skip to content

Commit d59a5e0

Browse files
committed
Correct variant name
1 parent d05c065 commit d59a5e0

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## v0.9.1 - 2022-02-04
4+
5+
- Corrected the `NotUTF8` file error variant name to `NotUtf8`.
6+
37
## v0.9.0 - 2022-01-26
48

59
- The `os` module gains the `family` function.

src/gleam/erlang/file.gleam

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ pub type Reason {
108108
/// Cross-domain link.
109109
Exdev
110110
/// File was requested to be read as UTF-8, but is not UTF-8 encoded.
111-
NotUTF8
111+
NotUtf8
112112
}
113113

114114
/// Returns true if path refers to a directory, otherwise false.
@@ -231,7 +231,7 @@ pub fn read(from path: String) -> Result(String, Reason) {
231231
|> result.then(fn(content) {
232232
case bit_string.to_string(content) {
233233
Ok(string) -> Ok(string)
234-
Error(Nil) -> Error(NotUTF8)
234+
Error(Nil) -> Error(NotUtf8)
235235
}
236236
})
237237
}

test/gleam/erlang/file_test.gleam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub fn non_utf8_test() {
2222
assert Error(file.Enoent) = file.read_bits(path)
2323

2424
assert Ok(Nil) = file.write_bits(<<255, 216, 255, 219>>, path)
25-
assert Error(file.NotUTF8) = file.read(path)
25+
assert Error(file.NotUtf8) = file.read(path)
2626
assert Ok(<<255, 216, 255, 219>>) = file.read_bits(path)
2727

2828
assert Ok(Nil) = file.delete(path)

0 commit comments

Comments
 (0)