Skip to content

Commit 45a0472

Browse files
committed
feat: use &str instead of &String
1 parent 8b80d6e commit 45a0472

File tree

1 file changed

+1
-1
lines changed
  • maximum_product_of_word_lengths/src

1 file changed

+1
-1
lines changed

maximum_product_of_word_lengths/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
pub struct Solution {}
22

33
impl Solution {
4-
fn cal_mask(word: &String) -> i32 {
4+
fn cal_mask(word: &str) -> i32 {
55
word.chars()
66
.fold(0, |acc, x| acc | 1 << (x as u8 - 'a' as u8))
77
}

0 commit comments

Comments
 (0)