Skip to content

Commit 0d692b0

Browse files
committed
build: correct linting errors
1 parent ddb47a9 commit 0d692b0

File tree

3 files changed

+19
-14
lines changed

3 files changed

+19
-14
lines changed

postgresql_commands/README.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,25 @@ A library for executing PostgreSQL command line utilities.
1212
## Examples
1313

1414
```rust
15+
use postgresql_commands::Result;
1516
use postgresql_commands::psql::PsqlBuilder;
1617

17-
let psql = PsqlBuilder::new()
18-
.command("CREATE DATABASE \"test\"")
19-
.host("127.0.0.1")
20-
.port(5432)
21-
.username("postgresql")
22-
.pg_password("password")
23-
.build();
24-
25-
let (stdout, stderr) = psql.execute(10).await?;
18+
fn main() -> Result<()> {
19+
let psql = PsqlBuilder::new()
20+
.command("CREATE DATABASE \"test\"")
21+
.host("127.0.0.1")
22+
.port(5432)
23+
.username("postgresql")
24+
.pg_password("password")
25+
.build();
26+
27+
let (stdout, stderr) = psql.execute()?;
28+
Ok(())
29+
}
2630
```
2731

2832
## Feature flags
2933

30-
postgresql_commands uses [feature flags] to address compile time and binary size
31-
uses.
32-
3334
The following features are available:
3435

3536
| Name | Description | Default? |

postgresql_embedded/src/postgresql.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ use postgresql_commands::initdb::InitDbBuilder;
77
use postgresql_commands::pg_ctl::Mode::{Start, Stop};
88
use postgresql_commands::pg_ctl::PgCtlBuilder;
99
use postgresql_commands::pg_ctl::ShutdownMode::Fast;
10-
use postgresql_commands::{AsyncCommandExecutor, CommandBuilder, CommandExecutor};
10+
#[cfg(feature = "tokio")]
11+
use postgresql_commands::AsyncCommandExecutor;
12+
use postgresql_commands::CommandBuilder;
13+
#[cfg(not(feature = "tokio"))]
14+
use postgresql_commands::CommandExecutor;
1115
use std::fs::{remove_dir_all, remove_file};
1216
use std::io::prelude::*;
1317
use std::net::TcpListener;

postgresql_embedded/src/settings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ impl Settings {
160160
/// Implement the [`Settings`] trait for [`Settings`]
161161
impl postgresql_commands::Settings for Settings {
162162
fn get_binary_dir(&self) -> PathBuf {
163-
self.get_binary_dir().clone()
163+
self.binary_dir().clone()
164164
}
165165

166166
fn get_host(&self) -> OsString {

0 commit comments

Comments
 (0)