async-rs / async-rs/async-std

Documentation request: Why do Task names get reallocated into a Box<str> ?

Open
#638 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
4.1k
Forks
339
PR merge metrics
No merged PRs in 30d

Description

When a String is provided as a Task name, it always gets reallocated (AFAICT) in this line of code:

https://github.com/async-rs/async-std/blob/master/src/task/task.rs#L33
```
name: name.map(String::into_boxed_str),
```

For my use case, this forces Task names to be unusable because that causes a lot of heap churn. If there's a good reason for this allocation, then I recommend documenting it. Thanks!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.