Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,17 @@ fn create_frame_string(value: Vec<String>) -> String {
.join(",")
}

/// This part of the code is not already used
#[allow(dead_code)]
fn concat_line(main_string: String, frame_string: String) -> String {
let buf: bool = false;
if buf {
let from: String = String::from("#####");
main_string.replace(&from, &frame_string)
} else {
format!("{}@{}", main_string, frame_string)
}
}
/// ## Basic listing of the library
/// ### Description
///
Expand Down Expand Up @@ -328,3 +339,10 @@ fn test_create_frame_string() {
let expected: String = "1-3,5".to_string();
assert_eq!(expected, create_frame_string(source));
}
#[test]
fn test_concat_line() {
let main_string: String = String::from("toto");
let frame_string: String = String::from("bar");
let expected: String = String::from("toto@bar");
assert_eq!(expected, concat_line(main_string, frame_string));
}
3 changes: 3 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ struct Args {
/// Represent output as a tree
#[arg(short, long)]
tree: bool,
/// Display Buf format
#[arg(short, long)]
buf: bool,

/// Path to parse
#[arg(value_name = "PATH", default_value_t = String::from("./"))]
Expand Down