Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Distinguish Rust character literals from lifetimes in the spacing helper

Open Beginner friendly
#888 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python, rust
Domain
testing, tooling

Research direction

Start with tools/format-rust.py, especially add_function_spacing and its lexical-state handling. Add focused Python tests for the reproduction, lifetimes, escaped quotes, and byte-character literals; verify that function boundaries are found, literal contents stay unchanged, and repeated runs are idempotent.

Written by the indexing model from the issue text.

Description

bug good first issue

Problem

An alphabetic char literal such as 'a' is treated as a lifetime prefix. Its closing quote opens char state, so function boundaries later in the file disappear.

Reproduction

Executed the helper at fd07427f4a976de05e38eff3ee1760db97fbb761 using importlib and add_function_spacing on:

fn first() {
    let c = 'a';
}
fn second() {}

The result is unchanged; the intended separating blank line is missing. Starting point: tools/format-rust.py.

Scope

Fix lexical state for character/escaped/byte-character literals while preserving lifetimes. Keep literal contents unchanged. Difficulty: easy.

Completion criteria

  • Find function boundaries after char literals.
  • Cover lifetimes, escaped quotes and byte chars.
  • Keep the helper idempotent with focused Python tests.
Dominant language
Rust
Stars
56
Forks
21
Avg merge
4h 58m
Merged PRs (30d)
54

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from wavefnd/Wave

All issues in wavefnd/Wave

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.