fitzgen / fitzgen/bumpalo

Idea: ToBumpString

Open
#74 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2.3k
Forks
157
Avg merge
3d 17h
Merged PRs (30d)
1

Description

I find I end up writing

```rust
let x = bumpalo::format!(in cx.bump, "{}", var).into_bump_str();
```

a lot, so my suggestion is to add

```rust
trait ToBumpString: Display {
fn to_bump_str<'a>(&self, arena: &'a Bump) -> &'a str {
bumpalo::format!(in arena, "{}", var).into_bump_str();
}
```

matching `ToString` (except that we want a `&str`).

Contributor guide

No contributing guide indexed for this repository

Research direction

Search the bumpalo crate for the format!, into_bump_str, Bump, Display, and ToString-related APIs mentioned in the issue, then inspect how public traits are organized. Done means the proposed ToBumpString behavior is integrated as a coherent public API, returns an arena-backed &str, and has coverage for formatting a Display value.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend-api-design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.