From 715078c75f5a042e85462cbf3e8756cfe3f4a562 Mon Sep 17 00:00:00 2001 From: Fernando Rojo Date: Wed, 31 Jan 2024 16:22:57 -0700 Subject: [PATCH] Fix stream read for cargo fallback (#994) --- .../rust/RustCliDetector.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.ComponentDetection.Detectors/rust/RustCliDetector.cs b/src/Microsoft.ComponentDetection.Detectors/rust/RustCliDetector.cs index e915fb3a7..fca3f7c19 100644 --- a/src/Microsoft.ComponentDetection.Detectors/rust/RustCliDetector.cs +++ b/src/Microsoft.ComponentDetection.Detectors/rust/RustCliDetector.cs @@ -262,7 +262,7 @@ private IComponentStream FindCorrespondingCargoLock(IComponentStream cargoToml, } else { - using var fileStream = new FileStream(cargoLockStream.Location, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); + var fileStream = new FileStream(cargoLockStream.Location, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); return new ComponentStream() { Location = cargoLockStream.Location,