rust-lang / rust-lang/rfcs

A few problems with the duration type

Open
#878 6 comments 13 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

T-libs
Dominant language
Markdown
Stars
6.6k
Forks
1.7k
Avg merge
16h 14m
Merged PRs (30d)
1

Description

I'm finding myself wanting to divide a Duration into another Duration, to get a percentage as a float (convert to float and then divide), and to multiply/divide Durations by Floats (convert to float, do operation, then back). Those div/mul implementations would be nice. Also, I can't seem to do math on durations without cloning them, when they come from a borrowed struct. Implementations on reference versions would be nice. Thoughts?

Sorry for the lack of detail, it's pretty late.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the issue and its six comments to understand the unresolved design discussion around Duration division, float multiplication and division, and operations on borrowed values. Done would require a settled proposal for the requested API changes, rather than the issue's current request for thoughts.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.