Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
What you've asked is a good question. I don't have an answer to that. I chose to solve the question as proposed before your answer because it requires a bit more from the coder, in this case, me.
Fair play, that is more elegant. As a question, why allow negative prices or servings?
The lambda function is being bound to the variable
test_password
, effectively making it a named function. ethan_ is code golfing for fun, which is when you try to complete a challenge with as few characters as possible. Maintainability isn't the goal.hey man, id say rather just throw it inside a function instead of lambda so it can be used more than just that line and easily modified in the future
I applied minimal changes to remove the warnings that appear in stderr, as well as updating the description for Rust to use the correct terms
field
andstruct
. Code style could also be improved but I didn't want to editorialize.This is the nature of
Freestyle Sparring.
We take turns remixing and refactoring each others code. If you want to make the code shorter, just fork it!🍴bro im trying to make the code short
I appreciate your counterplay - Good job!
using
string
as a parameter name is bad practice because it overwrites thestring
moduleAh, we've gone full circle now.
Interesting, thanks, we'll have to look at that with a benchmark.
This comment is hidden because it contains spoiler information about the solution
It doesn't seem to be bad at all. There are always nitpicks like an unecessary
.to_string()
before parsing and type hint that would have been inferred, but it looks like pretty standard Rust code.Though I do wonder, if you wanted to write a Perl solution, why not fork it in that language directly?
Thanks, I'm really not very good at Rust as you can probably tell.
Just so you know, the purpose of
.expect("text goes here")
is to provide context if the unwrap panics. If you don't feel the need to provide context, a simple.unwrap()
makes more sense.Loading more items...