Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Explain the <> more, in or before the Lifetimes chapter of TRPL where it first appears #26917

Closed

Description

@carols10cents

Some feedback from reddit:

Also, the functionsyntax hadn't come up previously [to the Lifetimes chapter], so it would be nice to expand on that.

The Lifetimes chapter currently has:

Before we get to that, though, let’s break the explicit example down:

fn bar<'a>(...)

This part declares our lifetimes. This says that bar has one lifetime, 'a. If we had two reference parameters, it would look like this:

fn bar<'a, 'b>(...)

Then in our parameter list, we use the lifetimes we’ve named:

which does say "declares our lifetimes", so maybe further explanation isn't appropriate here, but it looks like the Functions chapter is sticking to the bare minimum.

I'm not sure where this would fit, but I think the < > could use another sentence or two of explanation-- "This is where you declare lifetime and generic type parameters that this function is going to use" and link to the appropriate chapters for that perhaps?

Activity

  1. added 2 commits that reference this issue on Aug 5, 2015
    8f828a3
    43451bc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions