File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -184,6 +184,17 @@ fn create_frame_string(value: Vec<String>) -> String {
184184 . join ( "," )
185185}
186186
187+ /// This part of the code is not already used
188+ #[ allow( dead_code) ]
189+ fn concat_line ( main_string : String , frame_string : String ) -> String {
190+ let buf: bool = false ;
191+ if buf {
192+ let from: String = String :: from ( "#####" ) ;
193+ main_string. replace ( & from, & frame_string)
194+ } else {
195+ format ! ( "{}@{}" , main_string, frame_string)
196+ }
197+ }
187198/// ## Basic listing of the library
188199/// ### Description
189200///
@@ -328,3 +339,10 @@ fn test_create_frame_string() {
328339 let expected: String = "1-3,5" . to_string ( ) ;
329340 assert_eq ! ( expected, create_frame_string( source) ) ;
330341}
342+ #[ test]
343+ fn test_concat_line ( ) {
344+ let main_string: String = String :: from ( "toto" ) ;
345+ let frame_string: String = String :: from ( "bar" ) ;
346+ let expected: String = String :: from ( "toto@bar" ) ;
347+ assert_eq ! ( expected, concat_line( main_string, frame_string) ) ;
348+ }
Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ struct Args {
1818 /// Represent output as a tree
1919 #[ arg( short, long) ]
2020 tree : bool ,
21+ /// Display Buf format
22+ #[ arg( short, long) ]
23+ buf : bool ,
2124
2225 /// Path to parse
2326 #[ arg( value_name = "PATH" , default_value_t = String :: from( "./" ) ) ]
You can’t perform that action at this time.
0 commit comments