mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +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…
Reference in a new issue