Make FNL::new and FNL::with_seed const - #139
Conversation
|
Addresses #137. |
|
I'm looking to take fixes for a version bump, it seems this got forgetten about. If you get a moment could you take a look at this @Keavon |
@Kyllingene could you please check if that's still not stabilized? |
| ping_pong_strength: 2., | ||
|
|
||
| /* private */ fractal_bounding: 1. / 1.75, | ||
| /* private */ fractal_bounding: 0.5714285714, // = 1.0 / 1.75 |
There was a problem hiding this comment.
Is this change necessary? I think it might have been required in the past but now floating point math is allowed in const. I changed this locally and did a cargo check. Although I wonder if we'd need an MSRV declaration, which would make it a breaking change?
There was a problem hiding this comment.
I believe you're correct, certain float ops have since been stabilized in const. I would personally consider it something of a breaking change, so you'd have to decide how to handle that.
There was a problem hiding this comment.
I just checked that the float ops do now work on stable. Are you concerned about the bump of the MSRV as a breaking change? If so we could explicitly mention the minimum rust version needed as part of the package description so people who are still on older rust version could just the previous version
|
@Auburn what kind of version bump (in |
|
Likely y bump, mainly because I want to fix #172 which will change outputs slightly |
|
In that case, if it's already a breaking change to the behavior, it should probably be fine to raise the minimum supported Rust version. @Kyllingene could you please push a revert to the manual math calculation? |
|
I can, though my setup has since gone away. It might be a couple days before I get the time to get around to it, sorry. |
1 similar comment
|
I can, though my setup has since gone away. It might be a couple days before I get the time to get around to it, sorry. |
Makes the two constructors
const. Nothing else can beconstified because they're setters (which require&mut): the two fields that this is a limitation for aretransform_type_3dandfractal_bounding, as they are private. Others require float ops, and are thus also barred (such asget_noise_2d).If/when constant float ops are stabilized, this might warrant being revisited.