Skip to content

Commit

Permalink
Update to rust 1.75 πŸ¦€πŸ¦€πŸ¦€ (#1407)
Browse files Browse the repository at this point in the history
  • Loading branch information
rukai authored Jan 9, 2024
1 parent a545b41 commit 479feff
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.74"
channel = "1.75"
components = [ "rustfmt", "clippy" ]
targets = [ "aarch64-unknown-linux-gnu" ]
2 changes: 1 addition & 1 deletion shotover-proxy/tests/redis_int_tests/basic_driver_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,7 @@ async fn is_cluster_replicas_ready(connection: &mut Connection, master_id: &str)
.await
.unwrap();
if let Value::Bulk(data) = res {
if let Some(Value::Data(data)) = data.get(0) {
if let Some(Value::Data(data)) = data.first() {
return !data.is_empty();
}
}
Expand Down
2 changes: 1 addition & 1 deletion shotover/src/frame/redis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::message::QueryType;
#[inline]
pub fn redis_query_type(frame: &RedisFrame) -> QueryType {
if let RedisFrame::Array(frames) = frame {
if let Some(RedisFrame::BulkString(bytes)) = frames.get(0) {
if let Some(RedisFrame::BulkString(bytes)) = frames.first() {
return match bytes.to_ascii_uppercase().as_slice() {
b"APPEND" | b"BITCOUNT" | b"STRLEN" | b"GET" | b"GETRANGE" | b"MGET"
| b"LRANGE" | b"LINDEX" | b"LLEN" | b"SCARD" | b"SISMEMBER" | b"SMEMBERS"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ fn resolve_fragments_max_integer(fragments: Vec<Message>) -> Message {

fn get_upper_command_name(message: &mut Message) -> Vec<u8> {
if let Some(Frame::Redis(RedisFrame::Array(frames))) = message.frame() {
if let Some(RedisFrame::BulkString(bytes)) = frames.get(0) {
if let Some(RedisFrame::BulkString(bytes)) = frames.first() {
return bytes.to_ascii_uppercase();
}
}
Expand Down
2 changes: 1 addition & 1 deletion shotover/src/transforms/query_counter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ impl Transform for QueryCounter {

fn get_redis_query_type(frame: &RedisFrame) -> Option<String> {
if let RedisFrame::Array(array) = frame {
if let Some(RedisFrame::BulkString(v)) = array.get(0) {
if let Some(RedisFrame::BulkString(v)) = array.first() {
let upper_bytes = v.to_ascii_uppercase();
match String::from_utf8(upper_bytes) {
Ok(query_type) => {
Expand Down
2 changes: 1 addition & 1 deletion shotover/src/transforms/redis/sink_cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ pub enum ResponseJoin {
impl RoutingInfo {
#[inline(always)]
pub fn for_command_frame(args: &[RedisFrame]) -> Result<RoutingInfo> {
let command_name = match args.get(0) {
let command_name = match args.first() {
Some(RedisFrame::BulkString(command_name)) => command_name.to_ascii_uppercase(),
_ => bail!("syntax error: bad command name"),
};
Expand Down
2 changes: 1 addition & 1 deletion shotover/src/transforms/redis/timestamp_tagging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ impl Transform for RedisTimestampTagger {
if let Some(Frame::Redis(frame)) = message.frame() {
if let RedisFrame::Array(array) = frame {
if array
.get(0)
.first()
.map(|x| x == &RedisFrame::BulkString("EXEC".into()))
.unwrap_or(false)
{
Expand Down
2 changes: 1 addition & 1 deletion windsock/src/tables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub fn compare_by_name(names: &str) -> Result<()> {
names.split_whitespace().map(ReportColumn::load).collect();
let mut columns = columns?;

let baseline = columns.get(0).map(|x| x.current.clone());
let baseline = columns.first().map(|x| x.current.clone());
for column in &mut columns.iter_mut().skip(1) {
column.baseline = baseline.clone();
}
Expand Down

0 comments on commit 479feff

Please sign in to comment.