Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurZucker committed Aug 6, 2024
1 parent d30e10f commit c4b1470
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions bindings/node/src/tokenizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ impl Tokenizer {
.tokenizer
.write()
.unwrap()
.with_pre_tokenizer(Some(*pre_tokenizer).clone());
.with_pre_tokenizer(Some(*pre_tokenizer.clone()));
}

#[napi]
Expand All @@ -231,7 +231,7 @@ impl Tokenizer {
.tokenizer
.write()
.unwrap()
.with_post_processor(Some(*post_processor).clone());
.with_post_processor(Some(*post_processor.clone()));
}

#[napi]
Expand All @@ -240,7 +240,7 @@ impl Tokenizer {
.tokenizer
.write()
.unwrap()
.with_normalizer(Some(*normalizer).clone());
.with_normalizer(Some(*normalizer.clone()));
}

#[napi]
Expand Down
6 changes: 4 additions & 2 deletions bindings/python/src/tokenizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1377,7 +1377,8 @@ impl PyTokenizer {
/// Set the :class:`~tokenizers.normalizers.Normalizer`
#[setter]
fn set_pre_tokenizer(&mut self, pretok: Option<PyRef<PyPreTokenizer>>) {
self.tokenizer.with_pre_tokenizer(pretok.map(|pre| pre.clone()));
self.tokenizer
.with_pre_tokenizer(pretok.map(|pre| pre.clone()));
}

/// The `optional` :class:`~tokenizers.processors.PostProcessor` in use by the Tokenizer
Expand All @@ -1393,7 +1394,8 @@ impl PyTokenizer {
/// Set the :class:`~tokenizers.processors.PostProcessor`
#[setter]
fn set_post_processor(&mut self, processor: Option<PyRef<PyPostProcessor>>) {
self.tokenizer.with_post_processor(processor.map(|p| p.clone()));
self.tokenizer
.with_post_processor(processor.map(|p| p.clone()));
}

/// The `optional` :class:`~tokenizers.decoders.Decoder` in use by the Tokenizer
Expand Down

0 comments on commit c4b1470

Please sign in to comment.