summaryrefslogtreecommitdiff
path: root/src/client/client.rs
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-09-16 21:13:35 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-09-17 21:28:52 +0800
commita3b597ba7efbf7e0ddbe9d72e7202ea7a6b286a9 (patch)
treeef2ab58378c6f5009f9aa4d8560dd34bb6861f9b /src/client/client.rs
parent368aee800658e9c1a9a30871c45fc6034cceda48 (diff)
perf: use explicit 'a lifetime instead of 'static
Diffstat (limited to 'src/client/client.rs')
-rw-r--r--src/client/client.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client/client.rs b/src/client/client.rs
index 36afcf0..73a2c30 100644
--- a/src/client/client.rs
+++ b/src/client/client.rs
@@ -4,14 +4,14 @@ use whoami::{DesktopEnv, Language};
use crate::connector::Connection;
-pub struct Client<C: Connection> {
+pub struct Client<'a, C: Connection> {
pub connector: C,
ip: Option<IpAddr>,
hostname: String,
device_name: String,
- os: &'static str,
- cpu_arch: &'static str,
+ os: &'a str,
+ cpu_arch: &'a str,
distro: String,
desktop_env: DesktopEnv,
username: String,
@@ -20,7 +20,7 @@ pub struct Client<C: Connection> {
env: Vec<(String, String)>,
}
-impl<C: Connection> std::fmt::Display for Client<C> {
+impl<'a, C: Connection> std::fmt::Display for Client<'a, C> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(
f,
@@ -40,7 +40,7 @@ impl<C: Connection> std::fmt::Display for Client<C> {
}
}
-impl<C: Connection> Client<C> {
+impl<'a, C: Connection> Client<'a, C> {
pub fn new(connector: C) -> Result<Self, C::Err> {
let c = Self {
ip: connector.get_ip(),