Fix assigning_clones

Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
Christian König 2024-05-11 18:53:46 +00:00
parent 5fc8d2d3e6
commit 0884a0d76a
No known key found for this signature in database
2 changed files with 10 additions and 10 deletions

View file

@ -358,7 +358,7 @@ impl Session {
loop { loop {
match reader.read_event_into(&mut buf) { match reader.read_event_into(&mut buf) {
Ok(Event::Start(ref element)) => { Ok(Event::Start(ref element)) => {
current_element = std::str::from_utf8(element)?.to_owned() std::str::from_utf8(element)?.clone_into(&mut current_element)
} }
Ok(Event::End(_)) => { Ok(Event::End(_)) => {
current_element = String::new(); current_element = String::new();
@ -428,7 +428,7 @@ impl Session {
} }
pub fn set_client_id(&self, client_id: &str) { pub fn set_client_id(&self, client_id: &str) {
self.0.data.write().client_id = client_id.to_owned(); client_id.clone_into(&mut self.0.data.write().client_id);
} }
pub fn client_name(&self) -> String { pub fn client_name(&self) -> String {
@ -436,7 +436,7 @@ impl Session {
} }
pub fn set_client_name(&self, client_name: &str) { pub fn set_client_name(&self, client_name: &str) {
self.0.data.write().client_name = client_name.to_owned(); client_name.clone_into(&mut self.0.data.write().client_name);
} }
pub fn client_brand_name(&self) -> String { pub fn client_brand_name(&self) -> String {
@ -444,7 +444,7 @@ impl Session {
} }
pub fn set_client_brand_name(&self, client_brand_name: &str) { pub fn set_client_brand_name(&self, client_brand_name: &str) {
self.0.data.write().client_brand_name = client_brand_name.to_owned(); client_brand_name.clone_into(&mut self.0.data.write().client_brand_name);
} }
pub fn client_model_name(&self) -> String { pub fn client_model_name(&self) -> String {
@ -452,7 +452,7 @@ impl Session {
} }
pub fn set_client_model_name(&self, client_model_name: &str) { pub fn set_client_model_name(&self, client_model_name: &str) {
self.0.data.write().client_model_name = client_model_name.to_owned(); client_model_name.clone_into(&mut self.0.data.write().client_model_name);
} }
pub fn connection_id(&self) -> String { pub fn connection_id(&self) -> String {
@ -460,7 +460,7 @@ impl Session {
} }
pub fn set_connection_id(&self, connection_id: &str) { pub fn set_connection_id(&self, connection_id: &str) {
self.0.data.write().connection_id = connection_id.to_owned(); connection_id.clone_into(&mut self.0.data.write().connection_id);
} }
pub fn username(&self) -> String { pub fn username(&self) -> String {
@ -468,7 +468,7 @@ impl Session {
} }
pub fn set_username(&self, username: &str) { pub fn set_username(&self, username: &str) {
self.0.data.write().user_data.canonical_username = username.to_owned(); username.clone_into(&mut self.0.data.write().user_data.canonical_username);
} }
pub fn country(&self) -> String { pub fn country(&self) -> String {

View file

@ -239,9 +239,9 @@ impl SpClient {
let android_data = platform_data.mut_android(); let android_data = platform_data.mut_android();
android_data.android_version = os_version; android_data.android_version = os_version;
android_data.api_version = 31; android_data.api_version = 31;
android_data.device_name = "Pixel".to_owned(); "Pixel".clone_into(&mut android_data.device_name);
android_data.model_str = "GF5KQ".to_owned(); "GF5KQ".clone_into(&mut android_data.model_str);
android_data.vendor = "Google".to_owned(); "Google".clone_into(&mut android_data.vendor);
} }
"macos" => { "macos" => {
let macos_data = platform_data.mut_desktop_macos(); let macos_data = platform_data.mut_desktop_macos();