Skip to content

Commit

Permalink
fix clippy warning (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
syncpark committed Aug 28, 2023
1 parent 4335e6e commit 81dd3d1
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ file is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and
this project adheres to [Semantic
Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Changed

- Fix clippy warnings.

## [0.9.0] - 2023-07-27

### Changed
Expand Down Expand Up @@ -225,6 +231,7 @@ without relying on the content of the response.

- `send_frame` and `recv_frame` to send and receive length-delimited frames.

[Unreleased]: https://github.com/petabi/oinq/compare/0.8.2...main
[0.9.0]: https://github.com/petabi/oinq/compare/0.8.2...0.9.0
[0.8.2]: https://github.com/petabi/oinq/compare/0.8.1...0.8.2
[0.8.1]: https://github.com/petabi/oinq/compare/0.8.0...0.8.1
Expand Down
3 changes: 1 addition & 2 deletions src/frame.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
//! Functions and errors for handling length-delimited frames.

use std::{mem, num::TryFromIntError};

use bincode::Options;
use quinn::{RecvStream, SendStream};
use serde::{Deserialize, Serialize};
use std::{mem, num::TryFromIntError};
use thiserror::Error;

/// The error type for receiving and deserializing a frame.
Expand Down
17 changes: 12 additions & 5 deletions src/message.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
//! Functions and errors for handling messages.

use crate::{
frame::{self, RecvError, SendError},
RequestCode,
};
use bincode::Options;
use quinn::{Connection, ConnectionError, RecvStream, SendStream};
use semver::{Version, VersionReq};
Expand All @@ -10,11 +14,6 @@ use std::{
};
use thiserror::Error;

use crate::{
frame::{self, RecvError, SendError},
RequestCode,
};

/// Receives a message as a stream of bytes with a big-endian 4-byte length
/// header.
///
Expand All @@ -25,6 +24,10 @@ use crate::{
/// * `RecvError::DeserializationFailure` if the message could not be
/// deserialized
/// * `RecvError::ReadError` if the message could not be read
///
/// # Panics
///
/// * panic if it failed to convert 4 byte data to u32 value
pub async fn recv_request_raw<'b>(
recv: &mut RecvStream,
buf: &'b mut Vec<u8>,
Expand Down Expand Up @@ -150,6 +153,10 @@ pub async fn client_handshake(
/// # Errors
///
/// Returns `HandshakeError` if the handshake failed.
///
/// # Panics
///
/// * panic if it failed to parse version requirement string.
pub async fn server_handshake(
conn: &Connection,
addr: SocketAddr,
Expand Down
3 changes: 1 addition & 2 deletions src/request.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! Request handlers.

use crate::{frame, message, RequestCode};
use async_trait::async_trait;
use bincode::Options;
use ipnet::IpNet;
Expand All @@ -12,8 +13,6 @@ use std::{
};
use thiserror::Error;

use crate::{frame, message, RequestCode};

/// CPU, memory, and disk usage.
#[derive(Debug, Deserialize, Serialize)]
pub struct ResourceUsage {
Expand Down

0 comments on commit 81dd3d1

Please sign in to comment.