Closed icefoxen closed 2 years ago
Thanks for pointing this out! I don't think it would be a problem to return a mut ref to that block if the user needs it.
On that note, I don't think we really need the last_block
function, as it's just a wrapper around self.blocks.last(_mut)().unwrap()
. I'll add a deprecation warning to it.
Feel free to look over the linked PR (#18). I'd love to hear your thoughts.
The docstring for
Function::add_block()
saysAdds a new empty block with a specified label and returns it
, but the function doesn't return anything and you need to calllast_block()
instead. Is the function wrong, or the doc?Oh, also
last_block()
doesn't return a mutable reference, so you can't doadd_block()
thenlast_block()
and modify that block. TheFunction
type's contents are transparent, so you can just do it manually, but it's surprising.