@@ -150,8 +150,8 @@ impl<'d> L2capChannel<'d> {
150150
151151 /// Read metrics of the l2cap channel.
152152 #[ cfg( feature = "channel-metrics" ) ]
153- pub fn metrics < F : FnOnce ( & ChannelMetrics ) > ( & self , f : F ) {
154- self . manager . metrics ( self . index , f) ;
153+ pub fn metrics < F : FnOnce ( & ChannelMetrics ) -> R , R > ( & self , f : F ) -> R {
154+ self . manager . metrics ( self . index , f)
155155 }
156156
157157 /// Await an incoming connection request matching the list of PSM.
@@ -250,8 +250,8 @@ impl<'d> L2capChannelReader<'d> {
250250
251251 /// Read metrics of the l2cap channel.
252252 #[ cfg( feature = "channel-metrics" ) ]
253- pub fn metrics < F : FnOnce ( & ChannelMetrics ) > ( & self , f : F ) {
254- self . manager . metrics ( self . index , f) ;
253+ pub fn metrics < F : FnOnce ( & ChannelMetrics ) -> R , R > ( & self , f : F ) -> R {
254+ self . manager . metrics ( self . index , f)
255255 }
256256}
257257
@@ -300,7 +300,7 @@ impl<'d> L2capChannelWriter<'d> {
300300
301301 /// Read metrics of the l2cap channel.
302302 #[ cfg( feature = "channel-metrics" ) ]
303- pub fn metrics < F : FnOnce ( & ChannelMetrics ) > ( & self , f : F ) {
304- self . manager . metrics ( self . index , f) ;
303+ pub fn metrics < F : FnOnce ( & ChannelMetrics ) -> R , R > ( & self , f : F ) -> R {
304+ self . manager . metrics ( self . index , f)
305305 }
306306}
0 commit comments