Skip to content

Commit a83b250

Browse files
author
Hendrik van Antwerpen
committed
clippy
1 parent bae9f01 commit a83b250

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

crates/bpe-openai/build.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@ fn main() {
2323
}
2424

2525
fn serialize_tokens(name: &str, bpe: &CoreBPE, num_tokens: usize, hash_factor: u64) {
26-
let mut path = PathBuf::from(env::var("OUT_DIR").unwrap());
26+
let mut path = PathBuf::from(env::var("OUT_DIR").expect("OUT_DIR is set during build"));
2727
path.push(format!("bpe_{name}.dict"));
28-
let file = File::create(path).unwrap();
28+
let file = File::create(path).expect("can create output file");
2929
let mut serializer = rmp_serde::Serializer::new(file);
3030
let bpe = BytePairEncoding::from_tiktoken(bpe, num_tokens, Some(hash_factor));
31-
bpe.serialize(&mut serializer).unwrap();
31+
bpe.serialize(&mut serializer)
32+
.expect("serialization succeeds");
3233
}

0 commit comments

Comments
 (0)