Skip to content

Commit 51e32a6

Browse files
committed
Refactor use std::
1 parent fa9b8f4 commit 51e32a6

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

dscbicep/src/main.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use clap::Parser;
55
use dsc_lib::{
66
configure::config_doc::ExecutionKind, dscresources::dscresource::Invoke, DscManager,
77
};
8+
use std::{env, fs, io, process};
89
use tonic::{transport::Server, Request, Response, Status};
910

1011
// Include the generated protobuf code
@@ -241,7 +242,7 @@ async fn run_server(
241242
tracing::info!("Starting Bicep gRPC server on Unix socket: {}", socket_path);
242243

243244
// Remove the socket file if it exists
244-
let _ = std::fs::remove_file(&socket_path);
245+
let _ = fs::remove_file(&socket_path);
245246

246247
let uds = UnixListener::bind(&socket_path)?;
247248
let uds_stream = UnixListenerStream::new(uds);
@@ -279,7 +280,7 @@ async fn run_server(
279280

280281
#[tokio::main]
281282
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
282-
let trace_level = std::env::var("DSC_TRACE_LEVEL")
283+
let trace_level = env::var("DSC_TRACE_LEVEL")
283284
.ok()
284285
.and_then(|level| match level.to_uppercase().as_str() {
285286
"TRACE" => Some(tracing::Level::TRACE),
@@ -299,13 +300,13 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
299300

300301
let args = Args::parse();
301302

302-
if args.wait_for_debugger || std::env::var_os("DSC_GRPC_DEBUG").is_some() {
303+
if args.wait_for_debugger || env::var_os("DSC_GRPC_DEBUG").is_some() {
303304
tracing::warn!(
304305
"Press any key to continue after attaching to PID: {}",
305-
std::process::id()
306+
process::id()
306307
);
307308
let mut input = String::new();
308-
std::io::stdin().read_line(&mut input)?;
309+
io::stdin().read_line(&mut input)?;
309310
}
310311

311312
// Set up graceful shutdown on SIGTERM/SIGINT

0 commit comments

Comments
 (0)