Skip to content

Commit 582cf19

Browse files
committed
feat: v2.0.2
1 parent d6e7184 commit 582cf19

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "udp"
3-
version = "2.0.1"
3+
version = "2.0.2"
44
readme = "README.md"
55
edition = "2024"
66
authors = ["root@ltpp.vip"]

src/context/impl.rs

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

33
/// Implementation of InnerContext methods.
4+
impl Default for InnerContext {
5+
fn default() -> Self {
6+
Self::new()
7+
}
8+
}
9+
410
impl InnerContext {
511
/// Creates a new InnerContext with default values.
612
///
@@ -95,7 +101,7 @@ impl Context {
95101
///
96102
/// - `OptionSocketAddr` - Clone of the socket address if present.
97103
pub async fn get_socket_addr(&self) -> OptionSocketAddr {
98-
self.get().await.socket_addr.clone()
104+
self.get().await.socket_addr
99105
}
100106

101107
/// Gets the socket address or default if not present.
@@ -188,7 +194,7 @@ impl Context {
188194
.await
189195
.send(&self.get_socket().await, &self.get_socket_addr().await)
190196
.await;
191-
return response_result;
197+
response_result
192198
}
193199

194200
/// Sets a value in the context data storage.

src/response/error/impl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ impl Display for ResponseError {
1717
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1818
match self {
1919
Self::ResponseError(data) => write!(f, "Response Error{}{}", COLON_SPACE, data),
20-
Self::Unknown => write!(f, "{}", "Unknown"),
20+
Self::Unknown => write!(f, "Unknown"),
2121
}
2222
}
2323
}

0 commit comments

Comments
 (0)