Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
LeSim committed Sep 28, 2023
1 parent baed96e commit 4e0b961
Show file tree
Hide file tree
Showing 12 changed files with 5 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/crypto/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ impl<E> Stream for Decoder<E> {
type Item = Result<Bytes, E>;

fn poll_next(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Option<Self::Item>> {
let mut decoder = self.get_mut();
let decoder = self.get_mut();

match Pin::new(decoder.inner.as_mut()).poll_next(cx) {
Poll::Pending => {
Expand Down
2 changes: 1 addition & 1 deletion src/crypto/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ impl<E> Stream for Encoder<E> {
type Item = Result<Bytes, E>;

fn poll_next(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Option<Self::Item>> {
let mut encoder = self.get_mut();
let encoder = self.get_mut();

match Pin::new(encoder.inner.as_mut()).poll_next(cx) {
Poll::Pending => {
Expand Down
2 changes: 1 addition & 1 deletion src/http/handlers/forward.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pub async fn forward(
let (output_sha256, length) = buffer.sha256_and_len();
input_etag = Some(encrypted_stream.input_md5());

let stream_to_send = buffer.to_stream().await;
let stream_to_send = buffer.as_stream().await;

sign_request(
forwarded_req,
Expand Down
2 changes: 1 addition & 1 deletion src/http/utils/memory_or_file_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl MemoryOrFileBuffer {
}
}

pub async fn to_stream(
pub async fn as_stream(
&mut self,
) -> Box<dyn Stream<Item = Result<bytes::Bytes, Error>> + Unpin> {
match &mut self.file {
Expand Down
2 changes: 1 addition & 1 deletion src/http/utils/partial_extractor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl<E> Stream for PartialExtractor<E> {
type Item = Result<Bytes, E>;

fn poll_next(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Option<Self::Item>> {
let mut extractor = self.get_mut();
let extractor = self.get_mut();

match Pin::new(extractor.inner.as_mut()).poll_next(cx) {
Poll::Ready(Some(Ok(mut bytes))) => {
Expand Down
1 change: 0 additions & 1 deletion tests/concurrent_uploads.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use assert_fs::prelude::*;
use ds_proxy::crypto::header::*;
use serial_test::serial;
use std::sync::{Arc, Mutex};
use std::thread;
use std::time::Duration;
Expand Down
1 change: 0 additions & 1 deletion tests/content_length_and_transfert_encoding.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use ds_proxy::crypto::header::*;
use serial_test::serial;
use sodiumoxide::crypto::secretstream::xchacha20poly1305::{ABYTES, HEADERBYTES};
use std::fs::File;
use std::io::Write;
Expand Down
2 changes: 0 additions & 2 deletions tests/download_witness_file.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use serial_test::serial;

mod helpers;
pub use helpers::*;

Expand Down
1 change: 0 additions & 1 deletion tests/keyring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use std::convert::TryInto;

use assert_fs::prelude::*;
use ds_proxy::crypto::header;
use serial_test::serial;

mod helpers;
pub use helpers::*;
Expand Down
1 change: 0 additions & 1 deletion tests/ping.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use serial_test::serial;
use std::fs::File;
use std::{thread, time};

Expand Down
2 changes: 0 additions & 2 deletions tests/traversal_attack.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use serial_test::serial;

mod helpers;
pub use helpers::*;

Expand Down
1 change: 0 additions & 1 deletion tests/upload_and_download.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use assert_fs::prelude::*;
use ds_proxy::crypto::header::*;
use serial_test::serial;

mod helpers;
pub use helpers::*;
Expand Down

0 comments on commit 4e0b961

Please sign in to comment.