@@ -122,16 +122,16 @@ impl AtspiInjector {
122122
123123 debug ! (
124124 "Found editable element at path: {:?} in app: {:?}" ,
125- obj_ref. path, obj_ref. name
125+ obj_ref. path( ) , obj_ref. name( )
126126 ) ;
127127
128128 // Get EditableText proxy
129129 let editable_fut = EditableTextProxy :: builder ( zbus_conn)
130- . destination ( obj_ref. name . clone ( ) )
130+ . destination ( obj_ref. name ( ) . ok_or_else ( || InjectionError :: Other ( "AT-SPI object has no name" . to_string ( ) ) ) ? . clone ( ) )
131131 . map_err ( |e| {
132132 InjectionError :: Other ( format ! ( "EditableTextProxy destination failed: {e}" ) )
133133 } ) ?
134- . path ( obj_ref. path . clone ( ) )
134+ . path ( obj_ref. path ( ) . clone ( ) )
135135 . map_err ( |e| InjectionError :: Other ( format ! ( "EditableTextProxy path failed: {e}" ) ) ) ?
136136 . build ( ) ;
137137
@@ -144,9 +144,9 @@ impl AtspiInjector {
144144
145145 // Get Text proxy to determine caret position
146146 let text_iface_fut = TextProxy :: builder ( zbus_conn)
147- . destination ( obj_ref. name . clone ( ) )
147+ . destination ( obj_ref. name ( ) . ok_or_else ( || InjectionError :: Other ( "AT-SPI object has no name" . to_string ( ) ) ) ? . clone ( ) )
148148 . map_err ( |e| InjectionError :: Other ( format ! ( "TextProxy destination failed: {e}" ) ) ) ?
149- . path ( obj_ref. path . clone ( ) )
149+ . path ( obj_ref. path ( ) . clone ( ) )
150150 . map_err ( |e| InjectionError :: Other ( format ! ( "TextProxy path failed: {e}" ) ) ) ?
151151 . build ( ) ;
152152
@@ -161,7 +161,7 @@ impl AtspiInjector {
161161 . await
162162 . map_err ( |_| InjectionError :: Timeout ( per_method_timeout. as_millis ( ) as u64 ) ) ?
163163 . map_err ( |e| {
164- warn ! ( "Failed to get caret offset from {:?}: {}" , obj_ref. path, e) ;
164+ warn ! ( "Failed to get caret offset from {:?}: {}" , obj_ref. path( ) , e) ;
165165 InjectionError :: Other ( format ! ( "Text.caret_offset failed: {e}" ) )
166166 } ) ?;
167167
@@ -175,7 +175,7 @@ impl AtspiInjector {
175175 . map_err ( |e| {
176176 warn ! (
177177 "Failed to insert text at position {} in {:?}: {}" ,
178- caret, obj_ref. path, e
178+ caret, obj_ref. path( ) , e
179179 ) ;
180180 InjectionError :: Other ( format ! ( "EditableText.insert_text failed: {e}" ) )
181181 } ) ?;
@@ -193,7 +193,7 @@ impl AtspiInjector {
193193 debug ! (
194194 "Successfully inserted {} chars via AT-SPI to {:?} in {}ms" ,
195195 text. len( ) ,
196- obj_ref. name,
196+ obj_ref. name( ) ,
197197 elapsed. as_millis( )
198198 ) ;
199199
@@ -310,14 +310,14 @@ impl AtspiInjector {
310310
311311 debug ! (
312312 "Found editable element at path: {:?} in app: {:?}" ,
313- obj_ref. path, obj_ref. name
313+ obj_ref. path( ) , obj_ref. name( )
314314 ) ;
315315
316316 // Get Action proxy to trigger paste action
317317 let action_fut = ActionProxy :: builder ( zbus_conn)
318- . destination ( obj_ref. name . clone ( ) )
318+ . destination ( obj_ref. name ( ) . ok_or_else ( || InjectionError :: Other ( "AT-SPI object has no name" . to_string ( ) ) ) ? . clone ( ) )
319319 . map_err ( |e| InjectionError :: Other ( format ! ( "ActionProxy destination failed: {e}" ) ) ) ?
320- . path ( obj_ref. path . clone ( ) )
320+ . path ( obj_ref. path ( ) . clone ( ) )
321321 . map_err ( |e| InjectionError :: Other ( format ! ( "ActionProxy path failed: {e}" ) ) ) ?
322322 . build ( ) ;
323323
@@ -332,7 +332,7 @@ impl AtspiInjector {
332332 . await
333333 . map_err ( |_| InjectionError :: Timeout ( per_method_timeout. as_millis ( ) as u64 ) ) ?
334334 . map_err ( |e| {
335- warn ! ( "Failed to get actions from {:?}: {}" , obj_ref. path, e) ;
335+ warn ! ( "Failed to get actions from {:?}: {}" , obj_ref. path( ) , e) ;
336336 InjectionError :: Other ( format ! ( "Action.get_actions failed: {e}" ) )
337337 } ) ?;
338338
@@ -377,7 +377,7 @@ impl AtspiInjector {
377377 debug ! (
378378 "Successfully pasted {} chars via AT-SPI to {:?} in {}ms" ,
379379 text. len( ) ,
380- obj_ref. name,
380+ obj_ref. name( ) ,
381381 elapsed. as_millis( )
382382 ) ;
383383
0 commit comments