Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
sword-jin committed Jun 17, 2024
1 parent 0c3acd6 commit 7c27e23
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use std::net::SocketAddr;
use std::sync::Arc;
use tokio::io::{self, copy_bidirectional, AsyncReadExt, AsyncWriteExt};
use tokio::net::{TcpStream, UdpSocket};
use tokio::sync::{broadcast, mpsc, oneshot, RwLock};
use tokio::sync::{mpsc, oneshot, RwLock};
use tokio::time::{self, Duration, Instant};
use tokio_util::sync::CancellationToken;
use tracing::{debug, error, info, instrument, trace, warn, Instrument, Span};
Expand Down
8 changes: 4 additions & 4 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,9 @@ impl Config {
fn validate_server_config(server: &mut ServerConfig) -> Result<()> {
// Validate services
for (name, s) in &mut server.services {
s.name = name.clone();
s.name.clone_from(name);
if s.token.is_none() {
s.token = server.default_token.clone();
s.token.clone_from(&server.default_token);
if s.token.is_none() {
bail!("The token of service {} is not set", name);
}
Expand All @@ -272,9 +272,9 @@ impl Config {
fn validate_client_config(client: &mut ClientConfig) -> Result<()> {
// Validate services
for (name, s) in &mut client.services {
s.name = name.clone();
s.name.clone_from(name);
if s.token.is_none() {
s.token = client.default_token.clone();
s.token.clone_from(&client.default_token);
if s.token.is_none() {
bail!("The token of service {} is not set", name);
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub use config::Config;
pub use constants::UDP_BUFFER_SIZE;

use anyhow::Result;
use tokio::sync::{broadcast, mpsc};
use tokio::sync::mpsc;
use tokio_util::sync::CancellationToken;
use tracing::{debug, info};

Expand Down

0 comments on commit 7c27e23

Please sign in to comment.