@@ -479,8 +479,12 @@ impl<S: Read + Write> Client<S> {
479479 /// List all channels available for current connection
480480 pub fn channels ( & mut self ) -> Result < Vec < Channel > > {
481481 self . run_command ( "channels" , ( ) ) . and_then ( |_| self . read_list ( "channel" ) ) . map ( |v| {
482- v. into_iter ( ) . map ( |b| unsafe { Channel :: new_unchecked ( b) } ) . collect ( )
483- } )
482+ v. into_iter ( )
483+ . map ( |b| unsafe {
484+ Channel :: new_unchecked ( b)
485+ } )
486+ . collect ( )
487+ } )
484488 }
485489
486490 /// Read queued messages from subscribed channels
@@ -558,32 +562,26 @@ impl<S: Read + Write> Client<S> {
558562
559563 /// List all stickers from a given object, identified by type and uri
560564 pub fn stickers ( & mut self , typ : & str , uri : & str ) -> Result < Vec < String > > {
561- self . run_command ( "sticker list" , ( typ, uri) ) . and_then ( |_| self . read_list ( "sticker" ) ) . map ( |v| {
562- v. into_iter ( )
563- . map ( |b| {
564- b. splitn ( 2 , '=' )
565- . nth ( 1 )
566- . map ( |s| s. to_owned ( ) )
567- . unwrap ( )
568- } )
569- . collect ( )
570- } )
565+ self . run_command ( "sticker list" , ( typ, uri) )
566+ . and_then ( |_| self . read_list ( "sticker" ) )
567+ . map ( |v| v. into_iter ( ) . map ( |b| b. splitn ( 2 , '=' ) . nth ( 1 ) . map ( |s| s. to_owned ( ) ) . unwrap ( ) ) . collect ( ) )
571568 }
572569
573570 /// List all (file, sticker) pairs for sticker name and objects of given type
574571 /// from given directory (identified by uri)
575572 pub fn find_sticker ( & mut self , typ : & str , uri : & str , name : & str ) -> Result < Vec < ( String , String ) > > {
576- self . run_command ( "sticker find" , ( typ, uri, name) ) . and_then ( |_| {
577- self . read_pairs ( )
578- . split ( "file" )
579- . map ( |rmap| {
580- rmap. map ( |mut map| {
581- ( map. remove ( "file" ) . unwrap ( ) ,
582- map. remove ( "sticker" ) . and_then ( |s| s. splitn ( 2 , '=' ) . nth ( 1 ) . map ( |s| s. to_owned ( ) ) ) . unwrap ( ) )
583- } )
584- } )
585- . collect ( )
586- } )
573+ self . run_command ( "sticker find" , ( typ, uri, name) )
574+ . and_then ( |_| {
575+ self . read_pairs ( )
576+ . split ( "file" )
577+ . map ( |rmap| {
578+ rmap. map ( |mut map| {
579+ ( map. remove ( "file" ) . unwrap ( ) ,
580+ map. remove ( "sticker" ) . and_then ( |s| s. splitn ( 2 , '=' ) . nth ( 1 ) . map ( |s| s. to_owned ( ) ) ) . unwrap ( ) )
581+ } )
582+ } )
583+ . collect ( )
584+ } )
587585 }
588586
589587 /// List all files of a given type under given directory (identified by uri)
0 commit comments