postgres_ffi/wal_craft: simplify API

This commit is contained in:
Egor Suvorov
2022-07-07 16:53:12 +03:00
committed by Egor Suvorov
parent 0b5b2e8e0b
commit f540f115a3
3 changed files with 3 additions and 3 deletions

View File

@@ -621,7 +621,7 @@ mod tests {
fs::remove_dir_all(&cfg.datadir).unwrap();
}
cfg.initdb().unwrap();
let mut srv = cfg.start_server().unwrap();
let srv = cfg.start_server().unwrap();
let expected_wal_end: Lsn =
u64::from(C::craft(&mut srv.connect_with_timeout().unwrap()).unwrap()).into();
srv.kill();

View File

@@ -85,7 +85,7 @@ fn main() -> Result<()> {
datadir: arg_matches.value_of("datadir").unwrap().into(),
};
cfg.initdb()?;
let mut srv = cfg.start_server()?;
let srv = cfg.start_server()?;
wal_craft(arg_matches, &mut srv.connect_with_timeout()?)?;
srv.kill();
Ok(())

View File

@@ -154,7 +154,7 @@ impl PostgresServer {
bail!("Connection timed out");
}
pub fn kill(&mut self) {
pub fn kill(mut self) {
self.process.kill().unwrap();
self.process.wait().unwrap();
}