Refresh Rust dependencies and replace abandoned crates

This commit is contained in:
ms2k 2026-08-19 23:33:58 +09:00
commit e5c24f7c71

View file

@ -1,7 +1,7 @@
use std::time::Duration;
use redis::aio::{ConnectionManager, ConnectionManagerConfig};
use redis::{AsyncCommands, Client, FromRedisValue, RedisResult, Value};
use redis::{AsyncCommands, Client, FromRedisValue, Value};
use crate::error::CoordinationError;
use crate::keys::KeySpace;
@ -52,9 +52,9 @@ impl CoordinationStore {
CoordinationError::config(format!("invalid coordination URL: {error}"))
})?;
let connection_config = ConnectionManagerConfig::new()
.set_connection_timeout(Duration::from_secs(3))
.set_response_timeout(Duration::from_secs(5))
.set_max_delay(1_000);
.set_connection_timeout(Some(Duration::from_secs(3)))
.set_response_timeout(Some(Duration::from_secs(5)))
.set_max_delay(Duration::from_millis(1_000));
let conn = ConnectionManager::new_with_config(client, connection_config).await?;
Ok(Self {
conn,
@ -497,8 +497,7 @@ fn value_to_strings(value: &Value) -> Result<Vec<String>, CoordinationError> {
Value::Int(n) => out.push(n.to_string()),
other => {
// Fall back to Redis display for unexpected tags.
let as_string: RedisResult<String> =
FromRedisValue::from_redis_value(other);
let as_string = String::from_redis_value_ref(other);
out.push(as_string.unwrap_or_else(|_| format!("{other:?}")));
}
}