stevepryde/thirtyfour

`ElementQuery::first_opt` (version 0.28 port)

swizard0 opened this issue · 2 comments

Hello!

After upgrading to thirtyfour 0.28 I've encountered that ElementQuery::first_opt method signature has changed to pub async fn first_opt(&self) -> WebDriverResult<Option<WebElement<'_>>>. This change actually breaks my existing code, I has to refactor it with .all() / .into_iter() / .next() chain.

Is this change done on purpose? As far as I can see, the other methods (like first or all) bind WebElement lifetime to the WebDriver one, not with ElementQuery.

Hey, sorry it's taken so long to get to this. This does indeed look like a mistake! As part of the 0.28 refactor I did experiment with changing the first* methods but ended up changing them back. I obviously missed the lifetime change here.

My apologies. I'll fix it and release the fix as 0.28.1.

Meanwhile just a heads-up, the 0.28.x release series is likely to be the last before major breaking changes (effectively parts of this project will be merged into fantoccini and then the rest of this project will be refactored to sit on top). It's a fairly large undertaking and I'll need to produce documentation on how to migrate across. While the change will be unfortunately disruptive, the end result should be a win for users of both crates.

I will probably keep a 0.28.x branch around for bugfixes only.

Fixed in v0.28.1