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

Deprecate ::sleep(Number) #14962

Merged

Conversation

HertzDevil
Copy link
Contributor

This is in line with other places in the standard library that favor Time::Span over number types, such as #14368 and #14805.

@straight-shoota straight-shoota added this to the 1.14.0 milestone Sep 4, 2024
@straight-shoota straight-shoota merged commit f6e2ab3 into crystal-lang:master Sep 5, 2024
63 of 65 checks passed
@HertzDevil HertzDevil deleted the deprecate/sleep-number branch September 5, 2024 09:25
lachlan added a commit to lachlan/crystal-tds that referenced this pull request Oct 11, 2024
Compiling the TDS driver with Crystal v1.14.0 results in the
following warning:

    C:\crystal-tds>crystal spec
    In spec\spec_helper.cr:16:7

     16 | sleep(5)
          ^----
    Warning: Deprecated ::sleep. Use `::sleep(Time::Span)` instead

    A total of 1 warnings were found.

The `sleep(Number)` method has been deprecated in Crystal v1.14.0,
refer: crystal-lang/crystal#14962.

This fix changes the use of `sleep(Number)` to `sleep(Time::Span)`
in the `spec_helper.cr` file.
lachlan added a commit to lachlan/crystal-tds that referenced this pull request Oct 11, 2024
Compiling the TDS driver with Crystal v1.14.0 results in the
following warning:

    C:\crystal-tds>crystal spec
    In spec\spec_helper.cr:16:7

     16 | sleep(5)
          ^----
    Warning: Deprecated ::sleep. Use `::sleep(Time::Span)` instead

    A total of 1 warnings were found.

The `sleep(Number)` method has been deprecated in Crystal v1.14.0,
refer: crystal-lang/crystal#14962.

This fix changes the use of `sleep(Number)` to `sleep(Time::Span)`
in the `spec_helper.cr` file.
@crysbot
Copy link

crysbot commented Oct 12, 2024

This pull request has been mentioned on Crystal Forum. There might be relevant details there:

https://forum.crystal-lang.org/t/how-to-do-rand-0-2-0-5-after-deprecated-sleep/7299/2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants