Skip to content

Commit ba86c1b

Browse files
committed
feat: v2.1.1
1 parent a3067ea commit ba86c1b

File tree

9 files changed

+5
-25
lines changed

9 files changed

+5
-25
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "tcp-request"
3-
version = "2.1.0"
3+
version = "2.1.1"
44
edition = "2024"
55
authors = ["ltpp-universe <root@ltpp.vip>"]
66
license = "MIT"
@@ -16,7 +16,7 @@ exclude = [
1616
]
1717

1818
[dependencies]
19-
lombok-macros = "1.9.0"
19+
lombok-macros = "1.9.1"
2020

2121
[profile.dev]
2222
incremental = false
@@ -34,4 +34,4 @@ lto = true
3434
panic = "unwind"
3535
debug = false
3636
codegen-units = 1
37-
strip = "debuginfo"
37+
strip = "debuginfo"

sh/publish.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/bin/bash
2-
cargo publish --allow-dirty;
2+
cargo publish --allow-dirty;

sh/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/bin/bash
2-
cargo test -- --nocapture
2+
cargo test -- --nocapture

src/request/config/impl.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use crate::*;
22

33
impl Default for Config {
4-
#[inline]
54
fn default() -> Self {
65
Self {
76
timeout: DEFAULT_TIMEOUT,

src/request/error/impl.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use crate::*;
33
impl StdError for Error {}
44

55
impl Display for Error {
6-
#[inline]
76
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
87
match self {
98
Self::InvalidUrl => write!(f, "Invalid URL"),

src/request/request/impl.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use crate::*;
22

33
impl TcpRequest {
4-
#[inline]
54
fn send_request(
65
&mut self,
76
stream: &mut TcpStream,
@@ -16,7 +15,6 @@ impl TcpRequest {
1615
self.read_response(stream)
1716
}
1817

19-
#[inline]
2018
fn read_response(&mut self, stream: &mut TcpStream) -> Result<BoxResponseTrait, Error> {
2119
let cfg_buffer_size: usize = self
2220
.get_config()
@@ -38,7 +36,6 @@ impl TcpRequest {
3836
));
3937
}
4038

41-
#[inline]
4239
fn get_connection_stream(&self, host: String, port: usize) -> Result<TcpStream, Error> {
4340
let host_port: (String, u16) = (host.clone(), port as u16);
4441
let cfg_timeout: u64 = self
@@ -62,7 +59,6 @@ impl TcpRequest {
6259
impl RequestTrait for TcpRequest {
6360
type RequestResult = RequestResult;
6461

65-
#[inline]
6662
fn send(&mut self, data: &[u8]) -> Self::RequestResult {
6763
let cfg_timeout: Config = self
6864
.get_config()
@@ -79,7 +75,6 @@ impl RequestTrait for TcpRequest {
7975
}
8076

8177
impl Default for TcpRequest {
82-
#[inline]
8378
fn default() -> Self {
8479
Self {
8580
config: Arc::new(RwLock::new(Config::default())),

src/request/request_builder/impl.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use crate::*;
22

33
impl Default for RequestBuilder {
4-
#[inline]
54
fn default() -> Self {
65
Self {
76
tcp_request: TcpRequest::default(),
@@ -11,12 +10,10 @@ impl Default for RequestBuilder {
1110
}
1211

1312
impl RequestBuilder {
14-
#[inline]
1513
pub fn new() -> Self {
1614
Self::default()
1715
}
1816

19-
#[inline]
2017
pub fn host<T>(&mut self, host: T) -> &mut Self
2118
where
2219
T: Into<String>,
@@ -32,7 +29,6 @@ impl RequestBuilder {
3229
self
3330
}
3431

35-
#[inline]
3632
pub fn port(&mut self, port: usize) -> &mut Self {
3733
let _ = self
3834
.tcp_request
@@ -45,7 +41,6 @@ impl RequestBuilder {
4541
self
4642
}
4743

48-
#[inline]
4944
pub fn buffer(&mut self, buffer_size: usize) -> &mut Self {
5045
let _ = self
5146
.tcp_request
@@ -58,7 +53,6 @@ impl RequestBuilder {
5853
self
5954
}
6055

61-
#[inline]
6256
pub fn timeout(&mut self, timeout: u64) -> &mut Self {
6357
let _ = self
6458
.tcp_request
@@ -71,7 +65,6 @@ impl RequestBuilder {
7165
self
7266
}
7367

74-
#[inline]
7568
pub fn build(&mut self) -> BoxRequestTrait {
7669
self.builder = self.tcp_request.clone();
7770
self.tcp_request = TcpRequest::default();

src/response/response_binary/impl.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,17 @@ impl ResponseTrait for TcpResponseBinary {
44
type OutputText = TcpResponseText;
55
type OutputBinary = TcpResponseBinary;
66

7-
#[inline]
87
fn from(response: &[u8]) -> Self
98
where
109
Self: Sized,
1110
{
1211
response.to_vec()
1312
}
1413

15-
#[inline]
1614
fn binary(&self) -> Self::OutputBinary {
1715
self.clone()
1816
}
1917

20-
#[inline]
2118
fn text(&self) -> TcpResponseText {
2219
let data: String = String::from_utf8_lossy(&self).to_string();
2320
data

src/response/response_text/impl.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,17 @@ impl ResponseTrait for TcpResponseText {
44
type OutputText = TcpResponseText;
55
type OutputBinary = TcpResponseBinary;
66

7-
#[inline]
87
fn from(response: &[u8]) -> Self::OutputText
98
where
109
Self: Sized,
1110
{
1211
<TcpResponseBinary as ResponseTrait>::from(response).text()
1312
}
1413

15-
#[inline]
1614
fn text(&self) -> Self::OutputText {
1715
self.clone()
1816
}
1917

20-
#[inline]
2118
fn binary(&self) -> TcpResponseBinary {
2219
self.clone().into_bytes()
2320
}

0 commit comments

Comments
 (0)