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

Add (unstable) FnBox trait as a nicer replacement for Thunk. #23939

Merged
merged 3 commits into from
Apr 2, 2015

Commits on Apr 1, 2015

  1. Add (unstable) FnBox trait as a nicer replacement for Thunk. The doc

    comment includes a test that also shows how it can be used.
    nikomatsakis committed Apr 1, 2015
    Configuration menu
    Copy the full SHA
    ed63d32 View commit details
    Browse the repository at this point in the history
  2. Remove Thunk struct and Invoke trait; change Thunk to be an alias

    for `Box<FnBox()>`. I found the alias was still handy because it is
    shorter than the fully written type.
    
    This is a [breaking-change]: convert code using `Invoke` to use `FnBox`,
    which is usually pretty straight-forward. Code using thunk mostly works
    if you change `Thunk::new => Box::new` and `foo.invoke(arg)` to
    `foo(arg)`.
    nikomatsakis committed Apr 1, 2015
    Configuration menu
    Copy the full SHA
    cade32a View commit details
    Browse the repository at this point in the history
  3. Remove TODO

    nikomatsakis committed Apr 1, 2015
    Configuration menu
    Copy the full SHA
    8eed73f View commit details
    Browse the repository at this point in the history