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

Name some of the longer-lived lifetimes #333

Closed
wants to merge 3 commits into from

Conversation

stevenroose
Copy link

@stevenroose stevenroose commented Oct 26, 2021

Based on #330. Closes #331.

Lifetime names like 'a are usually more suitable for "anonymous"
lifetimes that have a limited scope. Lifetimes defined on types and
implementations can sometimes be more significant and it's usual to name
those with multi-character lifetime names.

I chose the following names:

  • 'bf: whenever there is some underlying (usually ephemeral) buffer
    This includes all the events and the ephemeral buffer in buffered
    readers.
  • 'inp: the underlying input bytes for a borrowing reader,
    Note that for events, the 'bf refers to this buffer too in the case of
    these readers.
  • In the BufferedInput trait, I used 'bf for slices it outputs from the
    buffer and 'int for the lifetime of the internal type, which is equal
    to 'inp for borrowing readers and the type lifetime of the BufRead for
    buffered readers (usually 'static).

@stevenroose stevenroose force-pushed the named-lifetimes branch 2 times, most recently from 5c18b3e to d2f7962 Compare October 26, 2021 14:06
Lifetime names like 'a are usually more suitable for "anonymous"
lifetimes that have a limited scope. Lifetimes defined on types and
implementations can sometimes be more significant and it's usual to name
those with multi-character lifetime names.

I chose the following names:
- 'bf: whenever there is some underlying (usually ephemeral) buffer
  This includes all the events and the ephemeral buffer in buffered
  readers.
- 'inp: the underlying input bytes for a borrowing reader,
  Note that for events, the 'bf refers to this buffer too in the case of
  these readers.
- In the BufferedInput trait, I used 'bf for slices it outputs from the
  buffer and 'int for the lifetime of the internal type, which is equal
  to 'inp for borrowing readers and the type lifetime of the BufRead for
  buffered readers (usually 'static).
@dralley
Copy link
Collaborator

dralley commented Jul 22, 2022

Some progress has been made on this

@dralley dralley closed this Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't use 'a for the underlying slice's lifetime
2 participants