Skip to content

Commit 67c2933

Browse files
committed
Remove outdated as_refs
1 parent 0e5c95f commit 67c2933

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ let results = [
3838
];
3939

4040
// Calculate new rating after 1.0 rating periods
41-
let new_rating = algorithm::rate_player(player, results.as_ref(), 1.0, parameters);
41+
let new_rating = algorithm::rate_player(player, &results, 1.0, parameters);
4242

4343
// The results are close to the results from the paper.
4444
assert!((new_rating.rating() - 1464.06).abs() < 0.01);

src/algorithm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,8 +510,8 @@ mod test {
510510
PlayerResult::new(opponent_c, 0.0),
511511
];
512512

513-
let new_rating: Rating = super::rate_player(player, results.as_ref(), 1.0, parameters)
514-
.into_with_parameters(parameters);
513+
let new_rating: Rating =
514+
super::rate_player(player, &results, 1.0, parameters).into_with_parameters(parameters);
515515

516516
assert_approx_eq!(new_rating.rating(), 1464.06, 0.01);
517517
assert_approx_eq!(new_rating.deviation(), 151.52, 0.01);

src/engine.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ impl Player {
3030
/// The match results the player had in the current rating period.
3131
#[must_use]
3232
pub fn current_rating_period_results(&self) -> &[PlayerResult] {
33-
self.current_rating_period_results.as_ref()
33+
&self.current_rating_period_results
3434
}
3535
}
3636

@@ -74,7 +74,7 @@ impl ScaledPlayer {
7474
/// The match results the player had in the current rating period.
7575
#[must_use]
7676
pub fn current_rating_period_results(&self) -> &[ScaledPlayerResult] {
77-
self.current_rating_period_results.as_ref()
77+
&self.current_rating_period_results
7878
}
7979
}
8080

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
//! ];
3737
//!
3838
//! // Calculate new rating after 1.0 rating periods
39-
//! let new_rating = algorithm::rate_player(player, results.as_ref(), 1.0, parameters);
39+
//! let new_rating = algorithm::rate_player(player, &results, 1.0, parameters);
4040
//!
4141
//! // The results are close to the results from the paper.
4242
//! assert!((new_rating.rating() - 1464.06).abs() < 0.01);

0 commit comments

Comments
 (0)