cargo fmt pass

This commit is contained in:
Stas Kelvich
2021-08-04 23:51:02 +03:00
parent 754892402c
commit fa04096733
8 changed files with 14 additions and 23 deletions

View File

@@ -50,7 +50,6 @@ impl<'a> Basebackup<'a> {
}
pub fn send_tarball(&mut self) -> anyhow::Result<()> {
// Create pgdata subdirs structure
for dir in pg_constants::PGDATA_SUBDIRS.iter() {
info!("send subdir {:?}", *dir);

View File

@@ -47,7 +47,6 @@ pub fn init_pageserver(
workdir: &Path,
create_tenant: Option<&str>,
) -> Result<()> {
env::set_current_dir(workdir)?;
// Initialize logger

View File

@@ -15,12 +15,12 @@ use bytes::{Buf, BufMut, Bytes, BytesMut};
use lazy_static::lazy_static;
use log::*;
use regex::Regex;
use zenith_metrics::{HistogramVec, register_histogram_vec};
use std::io::Write;
use std::net::TcpListener;
use std::str::FromStr;
use std::thread;
use std::{io, net::TcpStream};
use zenith_metrics::{register_histogram_vec, HistogramVec};
use zenith_utils::postgres_backend::PostgresBackend;
use zenith_utils::postgres_backend::{self, AuthType};
use zenith_utils::pq_proto::{
@@ -472,7 +472,11 @@ impl postgres_backend::Handler for PageServerHandler {
let modification = Modification::des(&bytes)?;
last_lsn = modification.lsn;
timeline.put_raw_data(modification.tag, modification.lsn, &modification.data)?;
timeline.put_raw_data(
modification.tag,
modification.lsn,
&modification.data,
)?;
}
FeMessage::CopyDone => {
timeline.advance_last_valid_lsn(last_lsn);

View File

@@ -53,10 +53,7 @@ pub enum RelishTag {
// relish. For example, pg_clog/0000, pg_clog/0001, and so forth.
//
// SLRU segments are divided into blocks, like relations.
Slru {
slru: SlruKind,
segno: u32,
},
Slru { slru: SlruKind, segno: u32 },
// Miscellaneous other files that need to be included in the
// tarball at compute node creation. These are non-blocky, and are
@@ -76,17 +73,12 @@ pub enum RelishTag {
// These files are always 512 bytes long (although we don't check
// or care about that in the page server).
//
FileNodeMap {
spcnode: Oid,
dbnode: Oid,
},
FileNodeMap { spcnode: Oid, dbnode: Oid },
//
// State files for prepared transactions (e.g pg_twophase/1234)
//
TwoPhase {
xid: TransactionId,
},
TwoPhase { xid: TransactionId },
// The control file, stored in global/pg_control
ControlFile,

View File

@@ -3,14 +3,14 @@
//! Otherwise, we might not see all metrics registered via
//! a default registry.
pub use prometheus::gather;
pub use prometheus::{Encoder, TextEncoder};
pub use prometheus::{linear_buckets, exponential_buckets};
pub use prometheus::{exponential_buckets, linear_buckets};
pub use prometheus::{register_histogram, Histogram};
pub use prometheus::{register_histogram_vec, HistogramVec};
pub use prometheus::{register_int_counter, IntCounter};
pub use prometheus::{register_int_counter_vec, IntCounterVec};
pub use prometheus::{register_int_gauge, IntGauge};
pub use prometheus::{register_int_gauge_vec, IntGaugeVec};
pub use prometheus::{Encoder, TextEncoder};
mod wrappers;
pub use wrappers::{CountedReader, CountedWriter};

View File

@@ -1,4 +1,4 @@
use std::io::{Result, Read, Write};
use std::io::{Read, Result, Write};
/// A wrapper for an object implementing [Read](std::io::Read)
/// which allows a closure to observe the amount of bytes read.

View File

@@ -4,8 +4,8 @@ use hyper::{
Body, Request, Response, Server,
};
use lazy_static::lazy_static;
use zenith_metrics::{Encoder, TextEncoder};
use zenith_metrics::{register_int_counter, IntCounter};
use zenith_metrics::{Encoder, TextEncoder};
lazy_static! {
static ref SERVE_METRICS_COUNT: IntCounter = register_int_counter!(

View File

@@ -80,10 +80,7 @@ pub fn query_from_cstring(query_string: Bytes) -> Vec<u8> {
}
impl PostgresBackend {
pub fn new(
socket: TcpStream,
auth_type: AuthType,
) -> io::Result<Self> {
pub fn new(socket: TcpStream, auth_type: AuthType) -> io::Result<Self> {
let mut pb = PostgresBackend {
stream_in: None,
stream_out: socket,