Skip to content

Commit

Permalink
test: Remove a reference when calling sort_by.
Browse files Browse the repository at this point in the history
Sorting by `&rev_cmp` is one more indirection than `rev_cmp` and it
does the same thing.
  • Loading branch information
Hywan authored and jplatte committed Jun 26, 2024
1 parent fb94401 commit 3c8fcb3
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions eyeball-im-util/tests/it/sort_by.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ where
#[test]
fn new() {
let ob = ObservableVector::<char>::from(vector!['c', 'a', 'd', 'b']);
let (values, mut sub) = ob.subscribe().sort_by(&rev_cmp);
let (values, mut sub) = ob.subscribe().sort_by(rev_cmp);

assert_eq!(values, vector!['d', 'c', 'b', 'a']);
assert_pending!(sub);
Expand All @@ -29,7 +29,7 @@ fn new() {
#[test]
fn append() {
let mut ob = ObservableVector::<char>::new();
let (values, mut sub) = ob.subscribe().sort_by(&rev_cmp);
let (values, mut sub) = ob.subscribe().sort_by(rev_cmp);

assert!(values.is_empty());
assert_pending!(sub);
Expand Down Expand Up @@ -61,7 +61,7 @@ fn append() {
#[test]
fn clear() {
let mut ob = ObservableVector::<char>::new();
let (values, mut sub) = ob.subscribe().sort_by(&rev_cmp);
let (values, mut sub) = ob.subscribe().sort_by(rev_cmp);

assert!(values.is_empty());
assert_pending!(sub);
Expand All @@ -86,7 +86,7 @@ fn clear() {
#[test]
fn push_front() {
let mut ob = ObservableVector::<char>::new();
let (values, mut sub) = ob.subscribe().sort_by(&rev_cmp);
let (values, mut sub) = ob.subscribe().sort_by(rev_cmp);

assert!(values.is_empty());
assert_pending!(sub);
Expand Down Expand Up @@ -120,7 +120,7 @@ fn push_front() {
#[test]
fn push_back() {
let mut ob = ObservableVector::<char>::new();
let (values, mut sub) = ob.subscribe().sort_by(&rev_cmp);
let (values, mut sub) = ob.subscribe().sort_by(rev_cmp);

assert!(values.is_empty());
assert_pending!(sub);
Expand Down Expand Up @@ -154,7 +154,7 @@ fn push_back() {
#[test]
fn insert() {
let mut ob = ObservableVector::<char>::new();
let (values, mut sub) = ob.subscribe().sort_by(&rev_cmp);
let (values, mut sub) = ob.subscribe().sort_by(rev_cmp);

assert!(values.is_empty());
assert_pending!(sub);
Expand Down Expand Up @@ -193,7 +193,7 @@ fn insert() {
#[test]
fn pop_front() {
let mut ob = ObservableVector::<char>::new();
let (values, mut sub) = ob.subscribe().sort_by(&rev_cmp);
let (values, mut sub) = ob.subscribe().sort_by(rev_cmp);

assert!(values.is_empty());
assert_pending!(sub);
Expand Down Expand Up @@ -231,7 +231,7 @@ fn pop_front() {
#[test]
fn pop_back() {
let mut ob = ObservableVector::<char>::new();
let (values, mut sub) = ob.subscribe().sort_by(&rev_cmp);
let (values, mut sub) = ob.subscribe().sort_by(rev_cmp);

assert!(values.is_empty());
assert_pending!(sub);
Expand Down Expand Up @@ -275,7 +275,7 @@ fn pop_back() {
#[test]
fn remove() {
let mut ob = ObservableVector::<char>::new();
let (values, mut sub) = ob.subscribe().sort_by(&rev_cmp);
let (values, mut sub) = ob.subscribe().sort_by(rev_cmp);

assert!(values.is_empty());
assert_pending!(sub);
Expand Down Expand Up @@ -306,7 +306,7 @@ fn remove() {
#[test]
fn set() {
let mut ob = ObservableVector::<char>::new();
let (values, mut sub) = ob.subscribe().sort_by(&rev_cmp);
let (values, mut sub) = ob.subscribe().sort_by(rev_cmp);

assert!(values.is_empty());
assert_pending!(sub);
Expand Down Expand Up @@ -344,7 +344,7 @@ fn set() {
#[test]
fn truncate() {
let mut ob = ObservableVector::<char>::new();
let (values, mut sub) = ob.subscribe().sort_by(&rev_cmp);
let (values, mut sub) = ob.subscribe().sort_by(rev_cmp);

assert!(values.is_empty());
assert_pending!(sub);
Expand Down Expand Up @@ -379,7 +379,7 @@ fn truncate() {
#[test]
fn reset() {
let mut ob = ObservableVector::<char>::with_capacity(1);
let (values, mut sub) = ob.subscribe().sort_by(&rev_cmp);
let (values, mut sub) = ob.subscribe().sort_by(rev_cmp);

assert!(values.is_empty());
assert_pending!(sub);
Expand Down

0 comments on commit 3c8fcb3

Please sign in to comment.