Skip to content

Conversation

@sunshowers
Copy link
Contributor

Similar to the other set_ methods -- it's possible to do this as bar.clone().with_elapsed but not very intuitive what that means.

Similar to the other `set_` methods -- it's possible to do this as
`bar.clone().with_elapsed` but not very intuitive what that means.
Copy link
Member

@djc djc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain your use case?

@sunshowers
Copy link
Contributor Author

Can you explain your use case?

There's a few spots in nextest that need to rewind the elapsed time to an earlier point. One example is https://github.com/nextest-rs/nextest/blob/83952e13433fa86c24e2cdef1aaddeacb6dd85f4/nextest-runner/src/reporter/displayer/progress.rs#L114 where after SIGTSTP and SIGCONT, elapsed timers need to be moved back by however long the invocation was paused. Right now I do this through clone + with_elapsed, but it's pretty non-intuitive that it does the right thing.

@sunshowers
Copy link
Contributor Author

The lint issue looks like something new in Rust 1.91, unrelated to the PR.

Copy link
Member

@djc djc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Would you like a release with this?

@sunshowers
Copy link
Contributor Author

Would you like a release with this?

If you have the time, sure, but it's not a huge rush since the clone workaround works fine.

@djc djc merged commit b31a0be into console-rs:main Nov 1, 2025
9 of 10 checks passed
@djc
Copy link
Member

djc commented Nov 1, 2025

Will release after

is merged.

@sunshowers sunshowers deleted the set-elapsed branch November 2, 2025 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants