Skip to content

Add InstantEx trait to support std::time::Instant operations. - #4

Open
osamasalem wants to merge 1 commit into
durationextender:mainfrom
osamasalem:main
Open

Add InstantEx trait to support std::time::Instant operations.#4
osamasalem wants to merge 1 commit into
durationextender:mainfrom
osamasalem:main

Conversation

@osamasalem

Copy link
Copy Markdown

Hey there 👋

I just added a couple of functions to the repo to support std::time::Instant operations, it is not my idea, we credit DHH for !! 😄

it is something like

let five_secs_ago = 5.seconds().ago();

So it returns an instant from 5 secs before now()

Let me know if anything else needed from this PR

Thansks

@osamasalem osamasalem changed the title add InstantEx trait Add InstantEx trait to support std::time::Instant operations. Oct 29, 2025
@JensMertelmeyer

Copy link
Copy Markdown

I think you could add some documentation about when to expect a runtime panic.

@durationextender

Copy link
Copy Markdown
Owner

Nice suggestion i will take a look at it!

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.

3 participants