ntex-rs / ntex

framework for composable networking services
Apache License 2.0
1.84k stars 105 forks source link

The `insert` method for `Extensions` does not return existed value #345

Closed photino closed 2 months ago

photino commented 2 months ago

The docs for insert says that

If a extension of this type already existed, it will be returned.

But it does not. The function signature should be

pub fn insert<T>(&mut self, val: T) -> Option<T>
where
    T: 'static,
fafhrd91 commented 2 months ago

fixed