@@ -358,7 +358,7 @@ impl Session {
358358 loop {
359359 match reader. read_event_into ( & mut buf) {
360360 Ok ( Event :: Start ( ref element) ) => {
361- current_element = std:: str:: from_utf8 ( element) ?. to_owned ( )
361+ std:: str:: from_utf8 ( element) ?. clone_into ( & mut current_element )
362362 }
363363 Ok ( Event :: End ( _) ) => {
364364 current_element = String :: new ( ) ;
@@ -428,47 +428,47 @@ impl Session {
428428 }
429429
430430 pub fn set_client_id ( & self , client_id : & str ) {
431- self . 0 . data . write ( ) . client_id = client_id . to_owned ( ) ;
431+ client_id . clone_into ( & mut self . 0 . data . write ( ) . client_id ) ;
432432 }
433433
434434 pub fn client_name ( & self ) -> String {
435435 self . 0 . data . read ( ) . client_name . clone ( )
436436 }
437437
438438 pub fn set_client_name ( & self , client_name : & str ) {
439- self . 0 . data . write ( ) . client_name = client_name . to_owned ( ) ;
439+ client_name . clone_into ( & mut self . 0 . data . write ( ) . client_name ) ;
440440 }
441441
442442 pub fn client_brand_name ( & self ) -> String {
443443 self . 0 . data . read ( ) . client_brand_name . clone ( )
444444 }
445445
446446 pub fn set_client_brand_name ( & self , client_brand_name : & str ) {
447- self . 0 . data . write ( ) . client_brand_name = client_brand_name . to_owned ( ) ;
447+ client_brand_name . clone_into ( & mut self . 0 . data . write ( ) . client_brand_name ) ;
448448 }
449449
450450 pub fn client_model_name ( & self ) -> String {
451451 self . 0 . data . read ( ) . client_model_name . clone ( )
452452 }
453453
454454 pub fn set_client_model_name ( & self , client_model_name : & str ) {
455- self . 0 . data . write ( ) . client_model_name = client_model_name . to_owned ( ) ;
455+ client_model_name . clone_into ( & mut self . 0 . data . write ( ) . client_model_name ) ;
456456 }
457457
458458 pub fn connection_id ( & self ) -> String {
459459 self . 0 . data . read ( ) . connection_id . clone ( )
460460 }
461461
462462 pub fn set_connection_id ( & self , connection_id : & str ) {
463- self . 0 . data . write ( ) . connection_id = connection_id . to_owned ( ) ;
463+ connection_id . clone_into ( & mut self . 0 . data . write ( ) . connection_id ) ;
464464 }
465465
466466 pub fn username ( & self ) -> String {
467467 self . 0 . data . read ( ) . user_data . canonical_username . clone ( )
468468 }
469469
470470 pub fn set_username ( & self , username : & str ) {
471- self . 0 . data . write ( ) . user_data . canonical_username = username . to_owned ( ) ;
471+ username . clone_into ( & mut self . 0 . data . write ( ) . user_data . canonical_username ) ;
472472 }
473473
474474 pub fn country ( & self ) -> String {
0 commit comments