/// Attempts to get at most one target. If there is more than one target,
/// returns an error.
/// TODO(fxb/47843): Implement target lookup for commands to deprecate this
/// function.
Attempts to get at most one target. If there is more than one target,
returns an error.
TODO(fxb/47843): Implement target lookup for commands to deprecate this
function.
Attempts to get at most one target . If there is more than one target returns an error . TODO ( fxb / 47843 ) : Implement target lookup for commands to deprecate this function .
async fn target_from_cache(&self) -> Result<Arc<Target>, Error> {
        let targets = self.target_collection.lock().await;
        if targets.len() > 1 {
            return Err(anyhow!("more than one target"));
        }
        match targets.iter().next() {
            Some(t) => Ok(t.clone()),
            None => Err(anyhow!("no targets found")),
        }
    }
async fn target_from_cache ( & self ) -> Result < Arc < Target > , Error > { let targets = self . target_collection . lock ( ) . await ; if targets . len ( ) > 1 { return Err ( anyhow ! ( " " ) ) ; } match targets . iter ( ) . next ( ) { Some ( t ) => Ok ( t . clone ( ) ) , None => Err ( anyhow ! ( " " ) ) , } }
Attempts to get at most one target.
Attempts to get at most one target .
&self