1
1
submitted 1 year ago by balp@lemmyrs.org to c/support@lemmyrs.org

As one more step in learning rust. I have done the Tennis Game Kata. There are a few tradeoff as some names being shorter than optimal, but by that preventing line breaks. That gives better overview.

Is there any rust constructions that would help making the code more readable?

Is there a cleaner solution to get the test parameterized?

Would there be a better fitting rust types for the functions? I started with the interface from Dani Pardo, in Emily Baches refactoring kata.

2
4

Hey there,
I'm trying to figure out licenses. My problem is that I want to showcase or make a portfolio out of my small projects on Gitlab (so as a private person without commercial interests) but I also don't want to the source code to be used commercially. (Yeah, I know. It's kinda arrogant to think that anyone would be interested in such small projects, but indulge me please.) Something along these lines:

  • Software is provided as is
  • Use if you want
  • Contribute if you want
  • Don't take credit
  • Don't sell

From what I read Creative Commons BY-NC(-SA) would be the goto but they advice against using it for software, since there are enough already (that's the gist I got from it). Reading about software licenses I found the Common Clause that seems to be like what I want to have.
But here comes the catch: If I want to use for instance clap, how do I go about it? Clap has a dual license model from what I understand: Apache-2 and MIT. Are they even compatible with Common Clause? Can I use clap if I use Common Clause and provide the license for clap?
All this legalese is tiring and wearing me out. Can anybody help me, and perhaps ELI5?
Thank you.

3
7
submitted 1 year ago by danyel@lemmyrs.org to c/support@lemmyrs.org

I've been using lazy_static until now but was trying to migrate to OnceCell. It seems I can't have a OnceCell even though I'm never calling mutable methods on the regex. I'm not even using multiple threads.

The error I'm getting is:

Any way to solve this or do I have to use OnceLock / continue using lazy_static? I don't want to add the overhead of using OnceLock if not necessary.

Rust: Support

3 readers
1 users here now

Rules

founded 1 year ago
MODERATORS