Skip to content

Deprecate ::sleep(Number)#14962

Merged
straight-shoota merged 1 commit intocrystal-lang:masterfrom
HertzDevil:deprecate/sleep-number
Sep 5, 2024
Merged

Deprecate ::sleep(Number)#14962
straight-shoota merged 1 commit intocrystal-lang:masterfrom
HertzDevil:deprecate/sleep-number

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
@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
Collaborator

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

wonderix pushed a commit to wonderix/crystal-tds that referenced this pull request Oct 14, 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.
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