Skip to content

Commit f44ddb5

Browse files
committed
code syntaxe fixing
1 parent 02ab7fe commit f44ddb5

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/number_theory/euler_totient.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@ mod tests {
7474
assert_eq!(
7575
euler_totient(input),
7676
expected,
77-
"φ({}) should be {}",
78-
input,
79-
expected
77+
"φ({input}) should be {expected}"
8078
);
8179
}
8280
}
@@ -99,10 +97,10 @@ mod tests {
9997

10098
#[test]
10199
fn test_prime_property() {
102-
// For any prime p, φ(p) = p - 1
103-
let primes = vec![2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31];
104-
for p in primes {
105-
assert_eq!(euler_totient(p), p - 1, "φ({}) should be {}", p, p - 1);
106-
}
100+
// For any prime p, φ(p) = p - 1
101+
let primes = vec![2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31];
102+
for p in primes {
103+
assert_eq!(euler_totient(p), p - 1, "φ({p}) should be {}", p - 1);
107104
}
108105
}
106+
}

0 commit comments

Comments
 (0)