bevyengine / bevyengine/bevy

RawHandleWrapper::set_display_handle is safe, but docs have a safety section.

Open
#24,497 1 comment 1 reaction 0 assignees View on GitHub
A-Rendering A-Windowing C-Docs D-Complex D-Unsafe S-Needs-Design
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

## How can Bevy's documentation be improved?

> Provide a link to the documentation and describe how it could be improved. In what ways is it incomplete, incorrect, or misleading?

[link](https://docs.rs/bevy_window/latest/bevy_window/struct.RawHandleWrapper.html#method.set_display_handle)
the method is not unsafe, but the docs have a safety section.
non-unsafe functions are always safe to call so either the method is unsound or the docs are wrong.

> If you have suggestions on exactly what the new docs should say, feel free to include them here. Alternatively, make the changes yourself and [create a pull request](https://bevy.org/learn/contribute/helping-out/writing-docs/) instead.

if the method is actually safe either remove or rename the safety section,
if the docs are correct and the method is unsafe to call then it should be unsafe.
i'm not sure which option is correct, windowing is confusing.

the link is to 0.18.1 docs, but the issue is also present on 0.19.0-rc2.

Contributor guide

Open the contributing guide

Research direction

Start with the linked RawHandleWrapper::set_display_handle documentation and compare its safety section with the method's Rust signature and surrounding windowing API docs. Determine whether the safety guidance or API declaration is incorrect; the work is done when the signature and documentation consistently describe how the method may be called.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop-dev, documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.