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
No related branches found
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> {
/// these numbers. Returns errors when the parsing fails.
pub fn read_command_line_builder() -> Result<(), String> {
// ANCHOR: matches
let matches =
let matches =
// ANCHOR: new_command
Command::new(COMMAND)
.author(AUTHOR)
......@@ -97,29 +97,28 @@ pub fn read_command_line_builder() -> Result<(), String> {
// ANCHOR_END: matches
// ANCHOR: numbers_matches
let numbers =
if let Some(count) =
let numbers = if let Some(count) =
// ANCHOR: get_one_matches
matches.get_one::<usize>("count")
// ANCHOR_END: get_one_matches
{
read_from_urandom(*count)?
} else if let Some(numbers) =
matches.get_one::<usize>("count")
// ANCHOR_END: get_one_matches
{
read_from_urandom(*count)?
} else if let Some(numbers) =
// ANCHOR: get_many_matches
matches.get_many::<i32>("numbers")
// ANCHOR_END: get_many_matches
{
numbers.copied().collect()
} else {
Vec::new()
};
matches.get_many::<i32>("numbers")
// ANCHOR_END: get_many_matches
{
numbers.copied().collect()
} else {
Vec::new()
};
// ANCHOR_END: numbers_matches
// ANCHOR: output_matches
if let Some(output) =
if let Some(output) =
// ANCHOR: get_one_string_matches
matches.get_one::<String>("output")
// ANCHOR_END: get_one_string_matches
matches.get_one::<String>("output")
// ANCHOR_END: get_one_string_matches
{
write_to_file(output, &numbers)?;
} else {
......
......@@ -38,7 +38,7 @@ fn main() {
safe_list.print();
unsafe_list.print();
for j in 1..1000 {
for _j in 1..1000 {
let mut ul = UnsafeList::new();
for i in 1..1_000_000 {
ul.push(i);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment