Not necessarily, mostly just musing/wondering what Rust's behavior actually is when there is no else clause... if every expression/statement has a value, what is the value of an if let when…
Either of the last two is fine by me
Done (6eeeb1c).
p.s. it would be sort of nice, and reasonably intuitive, if the default else-branch of an if let was just else {false}.
If this is…
So I guess I am specifically suggesting replacing this block with
if let Ok(spec) = SpecifiedValue::try_from(value.get_clone_untracked()) { valid.set(true) …
I've pushed changes that should resolve all the remaining conversations. If you agree, you can go ahead and review! Otherwise, let me know what other changes are needed.
I've switched to Proposal 1c (84bfdef), which we adopted during today's meeting. The SpecifiedValue
structure is read-only, courtesy of the readonly…
I don't actually see anything that needs to be done, do you? It seems like the defaults are all fine...
After looking it over during today's meeting, I agree that it seems possible to set up…
Your thoughts on just a method-only interface with an opaque underlying datatype that we can iterate on if we see fit without changing any client code?
At this point, I can't predict whether…
I've removed if_present
, replacing it with matches!(/* ... */, Present { .. })
where it was used (c58fed0)
The idea of using a parameterized trait is nice, but in this case I'd prefer to use methods named set
and set_if_ok
. The former always updates the set point, while the latter only updates the…
This is not the place to debate Husht […]
Agreed. I think you get the tradeoff at this point, so let me know whether you want to have is_present
.
Now a point might be that try_from doesn't give you a SpecifiedValue, it gives you a Result<SpecifiedValue, SomeKindaError>.
Exactly.
But then wouldn't it be most natural just to…
In the Absent case, it's the 0th tuple entry of the payload. In the Present case, it's the spec field of the payload.
If you find it less disorienting, we could do this:
pub enum…
[…] if I already have a SpecifiedValue, is there a way to make it the set_point of a Regulator? Perhaps there should be […]
Yes, I think we should add a set
method for this as soon as…
I think it's best to keep Husht as close as possible to Rust in terms of features, for two reasons.
- If a proposed Rust feature gets adopted by Husht but not by Rust, there's a danger that…