Skip to content

Commit

Permalink
Chore: make clippy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
iamazy committed Mar 21, 2024
1 parent 1c47666 commit e554fbf
Showing 1 changed file with 36 additions and 36 deletions.
72 changes: 36 additions & 36 deletions src/consumer/fetch_session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -768,10 +768,10 @@ mod tests {
add_topic_id(
&mut topic_ids,
&mut topic_names,
StrBytes::from_str("foo"),
StrBytes::from_static_str("foo"),
version,
);
let foo_id = match topic_ids.get("foo") {
let foo_id = match topic_ids.get(&StrBytes::from_static_str("foo")) {
Some(id) => *id,
None => Uuid::nil(),
};
Expand Down Expand Up @@ -803,8 +803,8 @@ mod tests {

assert_maps_equals(
&req_map(vec![
ReqEntry::new(StrBytes::from_str("foo"), foo_id, 0, 0, 100, 200),
ReqEntry::new(StrBytes::from_str("foo"), foo_id, 1, 10, 110, 210),
ReqEntry::new(StrBytes::from_static_str("foo"), foo_id, 0, 0, 100, 200),
ReqEntry::new(StrBytes::from_static_str("foo"), foo_id, 1, 10, 110, 210),
]),
vec![&data.to_send, &data.session_partitions],
);
Expand All @@ -813,8 +813,8 @@ mod tests {
assert_eq!(INITIAL_EPOCH, data.metadata.epoch);

let resp_map = resp_map(vec![
RespEntry::new(StrBytes::from_str("foo"), 0, foo_id, 0, 0),
RespEntry::new(StrBytes::from_str("foo"), 1, foo_id, 0, 0),
RespEntry::new(StrBytes::from_static_str("foo"), 0, foo_id, 0, 0),
RespEntry::new(StrBytes::from_static_str("foo"), 1, foo_id, 0, 0),
]);
let resp = to_fetch_response(0, 0, INVALID_SESSION_ID, resp_map);

Expand All @@ -840,7 +840,7 @@ mod tests {

assert_maps_equals(
&req_map(vec![ReqEntry::new(
StrBytes::from_str("foo"),
StrBytes::from_static_str("foo"),
foo_id,
0,
0,
Expand Down Expand Up @@ -869,10 +869,10 @@ mod tests {
add_topic_id(
&mut topic_ids,
&mut topic_names,
StrBytes::from_str("foo"),
StrBytes::from_static_str("foo"),
version,
);
let foo_id = match topic_ids.get("foo") {
let foo_id = match topic_ids.get(&StrBytes::from_static_str("foo")) {
Some(id) => *id,
None => Uuid::nil(),
};
Expand Down Expand Up @@ -908,8 +908,8 @@ mod tests {

assert_maps_equals(
&req_map(vec![
ReqEntry::new(StrBytes::from_str("foo"), foo_id, 0, 0, 100, 200),
ReqEntry::new(StrBytes::from_str("foo"), foo_id, 1, 10, 110, 210),
ReqEntry::new(StrBytes::from_static_str("foo"), foo_id, 0, 0, 100, 200),
ReqEntry::new(StrBytes::from_static_str("foo"), foo_id, 1, 10, 110, 210),
]),
vec![&data.to_send, &data.session_partitions],
);
Expand All @@ -922,8 +922,8 @@ mod tests {
0,
123,
resp_map(vec![
RespEntry::new(StrBytes::from_str("foo"), 0, foo_id, 10, 20),
RespEntry::new(StrBytes::from_str("foo"), 1, foo_id, 10, 20),
RespEntry::new(StrBytes::from_static_str("foo"), 0, foo_id, 10, 20),
RespEntry::new(StrBytes::from_static_str("foo"), 1, foo_id, 10, 20),
]),
);

Expand All @@ -934,10 +934,10 @@ mod tests {
add_topic_id(
&mut topic_ids,
&mut topic_names,
StrBytes::from_str("bar"),
StrBytes::from_static_str("bar"),
version,
);
let bar_id = match topic_ids.get("bar") {
let bar_id = match topic_ids.get(&StrBytes::from_static_str("bar")) {
Some(id) => *id,
None => Uuid::nil(),
};
Expand Down Expand Up @@ -985,16 +985,16 @@ mod tests {

assert_map_equals(
&req_map(vec![
ReqEntry::new(StrBytes::from_str("foo"), foo_id, 0, 0, 100, 200),
ReqEntry::new(StrBytes::from_str("foo"), foo_id, 1, 10, 120, 210),
ReqEntry::new(StrBytes::from_str("bar"), bar_id, 0, 20, 200, 200),
ReqEntry::new(StrBytes::from_static_str("foo"), foo_id, 0, 0, 100, 200),
ReqEntry::new(StrBytes::from_static_str("foo"), foo_id, 1, 10, 120, 210),
ReqEntry::new(StrBytes::from_static_str("bar"), bar_id, 0, 20, 200, 200),
]),
&data2.session_partitions,
);
assert_map_equals(
&req_map(vec![
ReqEntry::new(StrBytes::from_str("bar"), bar_id, 0, 20, 200, 200),
ReqEntry::new(StrBytes::from_str("foo"), foo_id, 1, 10, 120, 210),
ReqEntry::new(StrBytes::from_static_str("bar"), bar_id, 0, 20, 200, 200),
ReqEntry::new(StrBytes::from_static_str("foo"), foo_id, 1, 10, 120, 210),
]),
&data2.to_send,
);
Expand All @@ -1004,7 +1004,7 @@ mod tests {
0,
123,
resp_map(vec![RespEntry::new(
StrBytes::from_str("foo"),
StrBytes::from_static_str("foo"),
1,
foo_id,
20,
Expand Down Expand Up @@ -1066,9 +1066,9 @@ mod tests {

assert_maps_equals(
&req_map(vec![
ReqEntry::new(StrBytes::from_str("foo"), foo_id, 0, 0, 100, 200),
ReqEntry::new(StrBytes::from_str("foo"), foo_id, 1, 10, 120, 210),
ReqEntry::new(StrBytes::from_str("bar"), bar_id, 0, 20, 200, 200),
ReqEntry::new(StrBytes::from_static_str("foo"), foo_id, 0, 0, 100, 200),
ReqEntry::new(StrBytes::from_static_str("foo"), foo_id, 1, 10, 120, 210),
ReqEntry::new(StrBytes::from_static_str("bar"), bar_id, 0, 20, 200, 200),
]),
vec![&data4.session_partitions, &data4.to_send],
);
Expand All @@ -1091,21 +1091,21 @@ mod tests {
add_topic_id(
&mut topic_ids,
&mut topic_names,
StrBytes::from_str("foo"),
StrBytes::from_static_str("foo"),
version,
);
add_topic_id(
&mut topic_ids,
&mut topic_names,
StrBytes::from_str("bar"),
StrBytes::from_static_str("bar"),
version,
);

let foo_id = match topic_ids.get("foo") {
let foo_id = match topic_ids.get(&StrBytes::from_static_str("bar")) {
Some(id) => *id,
None => Uuid::nil(),
};
let bar_id = match topic_ids.get("bar") {
let bar_id = match topic_ids.get(&StrBytes::from_static_str("bar")) {
Some(id) => *id,
None => Uuid::nil(),
};
Expand Down Expand Up @@ -1150,9 +1150,9 @@ mod tests {
let data = fetch_session_builder.build(&mut fetch_session);
assert_maps_equals(
&req_map(vec![
ReqEntry::new(StrBytes::from_str("foo"), foo_id, 0, 0, 100, 200),
ReqEntry::new(StrBytes::from_str("foo"), foo_id, 1, 10, 110, 210),
ReqEntry::new(StrBytes::from_str("bar"), bar_id, 0, 20, 120, 220),
ReqEntry::new(StrBytes::from_static_str("foo"), foo_id, 0, 0, 100, 200),
ReqEntry::new(StrBytes::from_static_str("foo"), foo_id, 1, 10, 110, 210),
ReqEntry::new(StrBytes::from_static_str("bar"), bar_id, 0, 20, 120, 220),
]),
vec![&data.to_send, &data.session_partitions],
);
Expand All @@ -1163,9 +1163,9 @@ mod tests {
0,
123,
resp_map(vec![
RespEntry::new(StrBytes::from_str("foo"), 0, foo_id, 10, 20),
RespEntry::new(StrBytes::from_str("foo"), 1, foo_id, 10, 20),
RespEntry::new(StrBytes::from_str("bar"), 0, bar_id, 10, 20),
RespEntry::new(StrBytes::from_static_str("foo"), 0, foo_id, 10, 20),
RespEntry::new(StrBytes::from_static_str("foo"), 1, foo_id, 10, 20),
RespEntry::new(StrBytes::from_static_str("bar"), 0, bar_id, 10, 20),
]),
);

Expand All @@ -1190,7 +1190,7 @@ mod tests {
assert_eq!(1, data.metadata.epoch);
assert_map_equals(
&req_map(vec![ReqEntry::new(
StrBytes::from_str("foo"),
StrBytes::from_static_str("foo"),
foo_id,
1,
10,
Expand Down Expand Up @@ -1239,7 +1239,7 @@ mod tests {
assert_eq!(INITIAL_EPOCH, data.metadata.epoch);
assert_maps_equals(
&req_map(vec![ReqEntry::new(
StrBytes::from_str("foo"),
StrBytes::from_static_str("foo"),
foo_id,
0,
0,
Expand Down

0 comments on commit e554fbf

Please sign in to comment.