Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std: time: Avoid to use "was created" in elapsed() description #108370

Merged
merged 1 commit into from
Feb 24, 2023

Commits on Feb 22, 2023

  1. std: time: Avoid to use "was created" in elapsed() description

    ".. since this instant was created" is inaccurate and misleading,
    consider the following case:
    
    	let i1 = Instant::now(); // i1 is created at T1
    	let i2 = i1 + Duration::from_nanos(0); // i2 is "created" at T2
    	i2.elapsed(); // at T3
    
    Per the current description, `elapsed()` at T3 should return T3 - T2?
    
    Therefore removes the "was created" in the description of
    {Instant,SystemTime}::elapsed(). And since these types represent times,
    it's OK to use prepostions with them, e.g. "since this instant".
    fbq committed Feb 22, 2023
    Configuration menu
    Copy the full SHA
    b54a5fd View commit details
    Browse the repository at this point in the history