-
Notifications
You must be signed in to change notification settings - Fork 5
Add logs-generator #117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add logs-generator #117
Conversation
8a043e4 to
c2d9cc7
Compare
|
@perk-sumo Could we drop travis integration? |
| fn save_log(mut fd: &File, log: &String) -> u64 { | ||
| let write = fd.write_all(log.as_bytes()); | ||
| match write { | ||
| Ok(_result) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this rust wizardry? _err and _result are magic variable accessible when a function returns a Result?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this would be better explanation, than me trying to do that :D. doc
| } | ||
|
|
||
| fn get_random_word(wordlist: &Vec<String>) -> &String { | ||
| let mut rng = rand::thread_rng(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really so important but I guess this can somehow be initialized just once? Are there static variables in rust?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It ends with
error[E0133]: use of mutable static is unsafe and requires unsafe function or block
| random_words: u32, | ||
| random_digits: u32, | ||
| ) -> String { | ||
| let mut rng = rand::thread_rng(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto here
8e031f8 to
3832858
Compare
Signed-off-by: Dominik Rosiek <[email protected]> Co-authored-by: Patryk Małek <[email protected]>
3832858 to
9c5791f
Compare
See src/rust/logs-generator/README.md