@@ -75,19 +75,6 @@ pub struct Prompt {
7575 action : Arc < Mutex < Option < PromptAction > > > ,
7676}
7777
78- // Manual impl because OnceCell doesn't impl Debug
79- impl std:: fmt:: Debug for Prompt {
80- fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
81- f. debug_struct ( "Prompt" )
82- . field ( "service" , & self . service )
83- . field ( "role" , & self . role )
84- . field ( "path" , & self . path )
85- . field ( "label" , & self . label )
86- . field ( "collection" , & self . collection )
87- . finish ( )
88- }
89- }
90-
9178#[ cfg( any(
9279 feature = "gnome_openssl_crypto" ,
9380 feature = "gnome_native_crypto" ,
@@ -114,9 +101,9 @@ impl Prompt {
114101 PlasmaPrompterCallback :: new ( self . service . clone ( ) , self . path . clone ( ) ) . await ;
115102 let path = OwnedObjectPath :: from ( callback. path ( ) . clone ( ) ) ;
116103
117- self . plasma_callback
118- . set ( callback . clone ( ) )
119- . expect ( "A prompt callback is only set once" ) ;
104+ // We are sure the callback is not set at this point, so it is fine to ignore
105+ // the result of set
106+ let _ = self . plasma_callback . set ( callback. clone ( ) ) ;
120107 self . service
121108 . object_server ( )
122109 . at ( & path, callback. clone ( ) )
@@ -147,10 +134,9 @@ impl Prompt {
147134
148135 let path = OwnedObjectPath :: from ( callback. path ( ) . clone ( ) ) ;
149136
150- self . gnome_callback
151- . set ( callback. clone ( ) )
152- . expect ( "A prompt callback is only set once" ) ;
153-
137+ // We are sure the callback is not set at this point, so it is fine to ignore
138+ // the result of set
139+ let _ = self . gnome_callback . set ( callback. clone ( ) ) ;
154140 self . service . object_server ( ) . at ( & path, callback) . await ?;
155141 tracing:: debug!( "Prompt `{}` created." , self . path) ;
156142
0 commit comments