Skip to content
Snippets Groups Projects
Commit ca9acfde authored by orestis.malaspin's avatar orestis.malaspin
Browse files

Merge branch 'fix_formatting' into 'main'

Fix formatting

See merge request !78
parents 7678a15c 6a6c590a
Branches
No related tags found
1 merge request!78Fix formatting
Pipeline #33816 passed
...@@ -59,7 +59,7 @@ fn write_to_file(output: &str, numbers: &[i32]) -> Result<(), String> { ...@@ -59,7 +59,7 @@ fn write_to_file(output: &str, numbers: &[i32]) -> Result<(), String> {
/// these numbers. Returns errors when the parsing fails. /// these numbers. Returns errors when the parsing fails.
pub fn read_command_line_builder() -> Result<(), String> { pub fn read_command_line_builder() -> Result<(), String> {
// ANCHOR: matches // ANCHOR: matches
let matches = let matches =
// ANCHOR: new_command // ANCHOR: new_command
Command::new(COMMAND) Command::new(COMMAND)
.author(AUTHOR) .author(AUTHOR)
...@@ -97,29 +97,28 @@ pub fn read_command_line_builder() -> Result<(), String> { ...@@ -97,29 +97,28 @@ pub fn read_command_line_builder() -> Result<(), String> {
// ANCHOR_END: matches // ANCHOR_END: matches
// ANCHOR: numbers_matches // ANCHOR: numbers_matches
let numbers = let numbers = if let Some(count) =
if let Some(count) =
// ANCHOR: get_one_matches // ANCHOR: get_one_matches
matches.get_one::<usize>("count") matches.get_one::<usize>("count")
// ANCHOR_END: get_one_matches // ANCHOR_END: get_one_matches
{ {
read_from_urandom(*count)? read_from_urandom(*count)?
} else if let Some(numbers) = } else if let Some(numbers) =
// ANCHOR: get_many_matches // ANCHOR: get_many_matches
matches.get_many::<i32>("numbers") matches.get_many::<i32>("numbers")
// ANCHOR_END: get_many_matches // ANCHOR_END: get_many_matches
{ {
numbers.copied().collect() numbers.copied().collect()
} else { } else {
Vec::new() Vec::new()
}; };
// ANCHOR_END: numbers_matches // ANCHOR_END: numbers_matches
// ANCHOR: output_matches // ANCHOR: output_matches
if let Some(output) = if let Some(output) =
// ANCHOR: get_one_string_matches // ANCHOR: get_one_string_matches
matches.get_one::<String>("output") matches.get_one::<String>("output")
// ANCHOR_END: get_one_string_matches // ANCHOR_END: get_one_string_matches
{ {
write_to_file(output, &numbers)?; write_to_file(output, &numbers)?;
} else { } else {
......
...@@ -38,7 +38,7 @@ fn main() { ...@@ -38,7 +38,7 @@ fn main() {
safe_list.print(); safe_list.print();
unsafe_list.print(); unsafe_list.print();
for j in 1..1000 { for _j in 1..1000 {
let mut ul = UnsafeList::new(); let mut ul = UnsafeList::new();
for i in 1..1_000_000 { for i in 1..1_000_000 {
ul.push(i); ul.push(i);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment