fn server_from_weak(server: Option<&Weak<TestServer>>) -> Option<Option<Arc<TestServer>>> {
    if let Some(server) = server.as_ref() {
        // return None if can't upgrade
        let server = server.upgrade()?;

        Some(Some(server))
    } else {
        Some(None)
    }
}
/// Returns None if there was a weak server but we couldn't upgrade.
/// Returns Some(None) if there was no weak server
/// Returns Some(Some(fixture)) if there was a weak server that we can upgrade and make a fixture from
Returns None if there was a weak server but we couldn't upgrade.
Returns Some(None) if there was no weak server
Returns Some(Some(fixture)) if there was a weak server that we can upgrade and make a fixture from
Returns None if there was a weak server but we couldn ' t upgrade . Returns Some ( None ) if there was no weak server Returns Some ( Some ( fixture )) if there was a weak server that we can upgrade and make a fixture from
fn server_from_weak(server: Option<&Weak<TestServer>>) -> Option<Option<Arc<TestServer>>> {
    if let Some(server) = server.as_ref() {
        // return None if can't upgrade
        let server = server.upgrade()?;
        Some(Some(server))
    } else {
        Some(None)
    }
}
fn server_from_weak ( server : Option < & Weak < TestServer > > ) -> Option < Option < Arc < TestServer > > > { if let Some ( server ) = server . as_ref ( ) { // return None if can't upgrade let server = server . upgrade ( ) ? ; Some ( Some ( server ) ) } else { Some ( None ) } }
Returns None if there was a weak server but we couldn't upgrade.
Returns None if there was a weak server but we couldn ' t upgrade .
server
Option<&Weak<TestServer>>
server
Option<&Weak<TestServer>>