Skip to content

Commit fa15224

Browse files
committed
fix: correct linting errors
1 parent 2a429e5 commit fa15224

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

postgresql_commands/src/traits.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use std::env;
21
use crate::error::{Error, Result};
2+
use std::env::consts::OS;
33
use std::ffi::{OsStr, OsString};
44
use std::fmt::Debug;
55
use std::path::PathBuf;
@@ -147,7 +147,7 @@ impl CommandExecutor for std::process::Command {
147147
let stderr: String;
148148
let status: ExitStatus;
149149

150-
if env::consts::OS == "windows" && program.as_str().ends_with("pg_ctl") {
150+
if OS == "windows" && program.as_str().ends_with("pg_ctl") {
151151
// TODO: Processes can hang on Windows when attempting to get stdout/stderr using code
152152
// that works for Linux/MacOS; this implementation should be updated to retrieve the
153153
// values of stdout/stderr without hanging
@@ -166,9 +166,7 @@ impl CommandExecutor for std::process::Command {
166166
}
167167
debug!(
168168
"Result: {}\nstdout: {}\nstderr: {}",
169-
status
170-
.code()
171-
.map_or("None".to_string(), |c| c.to_string()),
169+
status.code().map_or("None".to_string(), |c| c.to_string()),
172170
stdout,
173171
stderr
174172
);
@@ -191,11 +189,11 @@ impl AsyncCommandExecutor for tokio::process::Command {
191189
Some(duration) => tokio::time::timeout(duration, self.output()).await?,
192190
None => self.output().await,
193191
}?;
194-
let program = self.get_program().to_string_lossy().to_string();
192+
let program = self.as_std().get_program().to_string_lossy().to_string();
195193
let stdout: String;
196194
let stderr: String;
197195

198-
if std::env::OS == "windows" && program.as_str().ends_with("pg_ctl") {
196+
if OS == "windows" && program.as_str().ends_with("pg_ctl") {
199197
// TODO: Processes can hang on Windows when attempting to get stdout/stderr using code
200198
// that works for Linux/MacOS; this implementation should be updated to retrieve the
201199
// values of stdout/stderr without hanging

0 commit comments

Comments
 (0)