mirror of
https://github.com/oSumAtrIX/free-librespot.git
synced 2025-12-19 18:04:20 +00:00
core API: SessionWeak.try_upgrade(), SessionWeak.upgrade()
This commit is contained in:
parent
ae85e69aca
commit
55f27a9e0a
1 changed files with 2 additions and 2 deletions
|
|
@ -213,11 +213,11 @@ impl Session {
|
|||
pub struct SessionWeak(pub Weak<SessionInternal>);
|
||||
|
||||
impl SessionWeak {
|
||||
pub fn try_upgrade(&self) -> Option<Session> {
|
||||
fn try_upgrade(&self) -> Option<Session> {
|
||||
self.0.upgrade().map(Session)
|
||||
}
|
||||
|
||||
pub fn upgrade(&self) -> Session {
|
||||
pub(crate) fn upgrade(&self) -> Session {
|
||||
self.try_upgrade().expect("Session died")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue