Skip to content

Commit e4948b0

Browse files
committed
[errors] refactor to new norad load and write error types
1 parent 2fe383c commit e4948b0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib/errors.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ lazy_static! {
1515
#[derive(Debug)]
1616
pub(crate) enum Error {
1717
InvalidPath(PathBuf),
18-
NoradRead(PathBuf, norad::Error),
19-
NoradWrite(PathBuf, norad::Error),
18+
NoradRead(PathBuf, norad::error::FontLoadError),
19+
NoradWrite(PathBuf, norad::error::FontWriteError),
2020
}
2121

2222
// Implementation adapted from https://www.lpalmieri.com/posts/error-handling-rust/
@@ -65,14 +65,14 @@ mod tests {
6565

6666
#[test]
6767
fn test_ufofmterror_read() {
68-
let ne = norad::Error::MissingLayer("test".to_owned());
68+
let ne = norad::error::FontLoadError::MissingDefaultLayer;
6969
let ufe = Error::NoradRead(PathBuf::from("test.ufo"), ne);
7070
assert!(ufe.to_string().starts_with("norad read error: "));
7171
}
7272

7373
#[test]
7474
fn test_ufofmterror_write() {
75-
let ne = norad::Error::MissingLayer("test".to_owned());
75+
let ne = norad::error::FontWriteError::PreexistingPublicObjectLibsKey;
7676
let ufe = Error::NoradWrite(PathBuf::from("test.ufo"), ne);
7777
assert!(ufe.to_string().starts_with("norad write error: "));
7878
}

0 commit comments

Comments
 (0)