Skip to content

Commit

Permalink
Merge fixups
Browse files Browse the repository at this point in the history
Signed-off-by: ikolomi <[email protected]>
  • Loading branch information
ikolomi committed Dec 5, 2024
1 parent ca73bef commit 93789f2
Show file tree
Hide file tree
Showing 17 changed files with 11 additions and 51 deletions.
1 change: 0 additions & 1 deletion benchmarks/rust/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
*/

#[cfg(not(target_env = "msvc"))]
use tikv_jemallocator::Jemalloc;

Expand Down
1 change: 0 additions & 1 deletion glide-core/build.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
*/

#[cfg(feature = "socket-layer")]
fn build_protobuf() {
let customization_options = protobuf_codegen::Customize::default()
Expand Down
2 changes: 1 addition & 1 deletion glide-core/redis-rs/redis/src/cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ impl<'a> Input<'a> {
}
}

impl<'a> Routable for Input<'a> {
impl Routable for Input<'_> {
fn arg_idx(&self, idx: usize) -> Option<&[u8]> {
match self {
Input::Slice { cmd: _, routable } => routable.arg_idx(idx),
Expand Down
2 changes: 1 addition & 1 deletion glide-core/redis-rs/redis/src/cluster_routing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1378,7 +1378,7 @@ impl ShardAddrs {
}
}

impl<'a> IntoIterator for &'a ShardAddrs {
impl IntoIterator for &ShardAddrs {
type Item = Arc<String>;
type IntoIter = std::iter::Chain<Once<Arc<String>>, std::vec::IntoIter<Arc<String>>>;

Expand Down
2 changes: 1 addition & 1 deletion glide-core/redis-rs/redis/src/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub struct Iter<'a, T: FromRedisValue> {
cmd: Cmd,
}

impl<'a, T: FromRedisValue> Iterator for Iter<'a, T> {
impl<T: FromRedisValue> Iterator for Iter<'_, T> {
type Item = T;

#[inline]
Expand Down
1 change: 0 additions & 1 deletion glide-core/redis-rs/redis/src/commands/cluster_scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ use strum_macros::Display;
/// The [[`ScanState`]] struct represents the state of a scan operation in a Redis cluster.
/// It holds information about the current scan state, including the cursor position, scanned slots map,
/// address being scanned, and address's epoch.
const BITS_PER_U64: usize = u64::BITS as usize;
const NUM_OF_SLOTS: usize = SLOT_SIZE as usize;
const BITS_ARRAY_SIZE: usize = NUM_OF_SLOTS / BITS_PER_U64;
Expand Down
4 changes: 2 additions & 2 deletions glide-core/redis-rs/redis/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ impl IntoConnectionInfo for ConnectionInfo {
/// - Specifying DB: `redis://127.0.0.1:6379/0`
/// - Enabling TLS: `rediss://127.0.0.1:6379`
/// - Enabling Insecure TLS: `rediss://127.0.0.1:6379/#insecure`
impl<'a> IntoConnectionInfo for &'a str {
impl IntoConnectionInfo for &str {
fn into_connection_info(self) -> RedisResult<ConnectionInfo> {
match parse_redis_url(self) {
Some(u) => u.into_connection_info(),
Expand Down Expand Up @@ -1578,7 +1578,7 @@ impl<'a> PubSub<'a> {
}
}

impl<'a> Drop for PubSub<'a> {
impl Drop for PubSub<'_> {
fn drop(&mut self) {
let _ = self.con.exit_pubsub();
}
Expand Down
4 changes: 2 additions & 2 deletions glide-core/redis-rs/redis/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1443,7 +1443,7 @@ impl ToRedisArgs for String {
}
}

impl<'a> ToRedisArgs for &'a str {
impl ToRedisArgs for &str {
fn write_redis_args<W>(&self, out: &mut W)
where
W: ?Sized + RedisWrite,
Expand All @@ -1465,7 +1465,7 @@ impl<T: ToRedisArgs> ToRedisArgs for Vec<T> {
}
}

impl<'a, T: ToRedisArgs> ToRedisArgs for &'a [T] {
impl<T: ToRedisArgs> ToRedisArgs for &[T] {
fn write_redis_args<W>(&self, out: &mut W)
where
W: ?Sized + RedisWrite,
Expand Down
1 change: 0 additions & 1 deletion glide-core/src/client/types.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
* Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
*/

#[allow(unused_imports)]
use logger_core::log_warn;
#[allow(unused_imports)]
Expand Down
1 change: 0 additions & 1 deletion glide-core/src/errors.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
* Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
*/

use redis::RedisError;

#[repr(C)]
Expand Down
1 change: 0 additions & 1 deletion glide-core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
* Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
*/

#[cfg(feature = "socket-layer")]
include!(concat!(env!("OUT_DIR"), "/protobuf/mod.rs"));
pub mod client;
Expand Down
1 change: 0 additions & 1 deletion glide-core/tests/test_socket_listener.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
* Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
*/

#![cfg(feature = "socket-layer")]
use glide_core::*;
use rsevents::{Awaitable, EventState, ManualResetEvent};
Expand Down
1 change: 0 additions & 1 deletion glide-core/tests/utilities/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
* Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
*/

#![allow(dead_code)]
use futures::Future;
use glide_core::{
Expand Down
18 changes: 0 additions & 18 deletions go/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
* Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
*/

#![deny(unsafe_op_in_unsafe_fn)]
use glide_core::client::Client as GlideClient;
use glide_core::connection_request;
Expand Down Expand Up @@ -79,23 +78,6 @@ impl Default for CommandResponse {
}
}

impl Default for CommandResponse {
fn default() -> Self {
CommandResponse {
response_type: ResponseType::default(),
int_value: 0,
float_value: 0.0,
bool_value: false,
string_value: ptr::null_mut(),
string_value_len: 0,
array_value: ptr::null_mut(),
array_value_len: 0,
map_key: ptr::null_mut(),
map_value: ptr::null_mut(),
}
}
}

#[repr(C)]
#[derive(Debug, Default)]
pub enum ResponseType {
Expand Down
4 changes: 2 additions & 2 deletions node/rust-client/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use glide_core::Telemetry;
use redis::GlideConnectionOptions;
/**
* Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
*/
use glide_core::Telemetry;
use redis::GlideConnectionOptions;

#[cfg(not(target_env = "msvc"))]
use tikv_jemallocator::Jemalloc;
Expand Down
14 changes: 0 additions & 14 deletions node/tests/GlideClusterClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,20 +406,6 @@ describe("GlideClusterClient", () => {
const client = await GlideClusterClient.createClient(
getClientConfigurationOption(cluster.getAddresses(), protocol),
);
const lmpopArr = [];

if (!cluster.checkIfServerVersionLessThan("7.0.0")) {
lmpopArr.push(
client.lmpop(["abc", "def"], ListDirection.LEFT, {
count: 1,
}),
);
lmpopArr.push(
client.blmpop(["abc", "def"], ListDirection.RIGHT, 0.1, {
count: 1,
}),
);
}

const promises: Promise<unknown>[] = [
client.blpop(["abc", "zxy", "lkn"], 0.1),
Expand Down
4 changes: 2 additions & 2 deletions python/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use bytes::Bytes;
use glide_core::client::FINISHED_SCAN_CURSOR;
/**
* Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
*/
use bytes::Bytes;
use glide_core::client::FINISHED_SCAN_CURSOR;
use glide_core::start_socket_listener;
use glide_core::Telemetry;
use glide_core::MAX_REQUEST_ARGS_LENGTH;
Expand Down

0 comments on commit 93789f2

Please sign in to comment.