Skip to content

Commit 9ff168a

Browse files
committed
fix(vm): satisfy clippy for local engine fallback
Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent 871fad3 commit 9ff168a

1 file changed

Lines changed: 13 additions & 15 deletions

File tree

crates/openshell-driver-vm/src/driver.rs

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,25 +1557,23 @@ fn parse_registry_reference(image_ref: &str) -> Result<Reference, Status> {
15571557
/// `DOCKER_HOST`). If Docker is unavailable, falls back to the Podman
15581558
/// socket, which exposes a Docker-compatible API.
15591559
async fn connect_local_container_engine() -> Option<Docker> {
1560-
if let Ok(docker) = Docker::connect_with_local_defaults() {
1561-
if docker.ping().await.is_ok() {
1562-
return Some(docker);
1563-
}
1560+
if let Ok(docker) = Docker::connect_with_local_defaults()
1561+
&& docker.ping().await.is_ok()
1562+
{
1563+
return Some(docker);
15641564
}
15651565

15661566
let podman_socket = podman_socket_path();
1567-
if podman_socket.exists() {
1568-
if let Ok(docker) =
1567+
if podman_socket.exists()
1568+
&& let Ok(docker) =
15691569
Docker::connect_with_unix(podman_socket.to_str()?, 120, bollard::API_DEFAULT_VERSION)
1570-
{
1571-
if docker.ping().await.is_ok() {
1572-
info!(
1573-
socket = %podman_socket.display(),
1574-
"vm driver: connected to Podman (Docker-compatible API)"
1575-
);
1576-
return Some(docker);
1577-
}
1578-
}
1570+
&& docker.ping().await.is_ok()
1571+
{
1572+
info!(
1573+
socket = %podman_socket.display(),
1574+
"vm driver: connected to Podman (Docker-compatible API)"
1575+
);
1576+
return Some(docker);
15791577
}
15801578

15811579
None

0 commit comments

Comments
 (0)