mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 09:20:10 +08:00
d32fee74f9
This can be used when you primarily want to return a reference but in order for that reference to live long enough it must be returned with an object. i.e. given `Mutex<Foo { bar }>` you want a function to lock the mutex and return a reference to `bar` but you can't return that reference since it has a lifetime dependency on `MutexGuard` (which only derefs to all of `Foo` and not just `bar`). You can return a `Projection` owning the `MutexGuard<Foo>` and set it up to deref to `&bar`. |
||
---|---|---|
.. | ||
src | ||
widestring-suffix | ||
build.rs | ||
Cargo.lock | ||
Cargo.toml |