@@ -166,7 +166,7 @@ impl FromStr for Event {
166166}
167167
168168impl fmt:: Display for Event {
169- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
169+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
170170 match self {
171171 Event :: Started => write ! ( f, "started" ) ,
172172 Event :: Stopped => write ! ( f, "stopped" ) ,
@@ -194,7 +194,7 @@ pub enum Compact {
194194}
195195
196196impl fmt:: Display for Compact {
197- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
197+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
198198 match self {
199199 Compact :: Accepted => write ! ( f, "1" ) ,
200200 Compact :: NotAccepted => write ! ( f, "0" ) ,
@@ -264,12 +264,10 @@ fn extract_info_hash(query: &Query) -> Result<InfoHash, ParseAnnounceQueryError>
264264 } ) ?,
265265 )
266266 }
267- None => {
268- return Err ( ParseAnnounceQueryError :: MissingParam {
269- location : Location :: caller ( ) ,
270- param_name : INFO_HASH . to_owned ( ) ,
271- } )
272- }
267+ None => Err ( ParseAnnounceQueryError :: MissingParam {
268+ location : Location :: caller ( ) ,
269+ param_name : INFO_HASH . to_owned ( ) ,
270+ } ) ,
273271 }
274272}
275273
@@ -282,12 +280,10 @@ fn extract_peer_id(query: &Query) -> Result<peer::Id, ParseAnnounceQueryError> {
282280 source : Located ( err) . into ( ) ,
283281 } ) ?,
284282 ) ,
285- None => {
286- return Err ( ParseAnnounceQueryError :: MissingParam {
287- location : Location :: caller ( ) ,
288- param_name : PEER_ID . to_owned ( ) ,
289- } )
290- }
283+ None => Err ( ParseAnnounceQueryError :: MissingParam {
284+ location : Location :: caller ( ) ,
285+ param_name : PEER_ID . to_owned ( ) ,
286+ } ) ,
291287 }
292288}
293289
@@ -298,12 +294,10 @@ fn extract_port(query: &Query) -> Result<u16, ParseAnnounceQueryError> {
298294 param_value : raw_param. clone ( ) ,
299295 location : Location :: caller ( ) ,
300296 } ) ?) ,
301- None => {
302- return Err ( ParseAnnounceQueryError :: MissingParam {
303- location : Location :: caller ( ) ,
304- param_name : PORT . to_owned ( ) ,
305- } )
306- }
297+ None => Err ( ParseAnnounceQueryError :: MissingParam {
298+ location : Location :: caller ( ) ,
299+ param_name : PORT . to_owned ( ) ,
300+ } ) ,
307301 }
308302}
309303
0 commit comments