Skip to content

CircuitBase::last_stream_id has suspicious return type #5955

@blp

Description

@blp

The CircuitBase trait has a method defined this way:

    /// Reference to the global counter shared by all circuits.
    fn last_stream_id(&self) -> RefCell<StreamId>;

I don't understand the return type. Returning a RefCell by value is like returning a Mutex by value; it doesn't give you any kind of reference. If this method is supposed to return a reference to something, then it should return a reference. As-is, it's effectively just returning the last stream ID wrapped in a RefCell.

Metadata

Metadata

Assignees

Labels

DBSP coreRelated to the core DBSP library

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions