Skip to content

Commit

Permalink
Add const keywords to some functions
Browse files Browse the repository at this point in the history
  • Loading branch information
vbkaisetsu committed Sep 23, 2024
1 parent 281b47f commit 0697bef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion vaporetto/src/dict_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl WordWeightRecord {
pub struct DictModel(pub(crate) Vec<WordWeightRecord>);

impl DictModel {
pub fn new(dict: Vec<WordWeightRecord>) -> Self {
pub const fn new(dict: Vec<WordWeightRecord>) -> Self {
Self(dict)
}

Expand Down
2 changes: 1 addition & 1 deletion vaporetto/src/predictor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ pub struct PositionalWeight<W> {
}

impl PositionalWeight<Vec<i32>> {
pub fn new(offset: i16, weight: Vec<i32>) -> Self {
pub const fn new(offset: i16, weight: Vec<i32>) -> Self {
Self { offset, weight }
}
}
Expand Down

0 comments on commit 0697bef

Please sign in to comment.