Skip to content

Stdin:read_line does not need &mut self #26890

Closed
@RalfJung

Description

@RalfJung

Currently, Stdin::read_line takes self as &mut. Why is that? The implementation simply locks and calls read_line on the guard, and locking doesn't need a mutable self. So this is unnecessary, and the doc doesn't say why this was done. (Nor does the source.)

So I propose for this to be changed to &self. Looks like an oversight of some refactoring to me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions