Skip to content

Commit

Permalink
Fixed code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Hirevo committed Jan 18, 2020
1 parent 8fc0e6e commit 52fddd4
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion persist-daemon/src/server/request/delete.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::sync::Arc;

use futures::sink::SinkExt;
use tokio_util::codec::{Framed, LinesCodec};
use tokio::net::UnixStream;
use tokio_util::codec::{Framed, LinesCodec};

use persist_core::error::Error;
use persist_core::protocol::{DeleteRequest, DeleteResponse, Response};
Expand Down
2 changes: 1 addition & 1 deletion persist-daemon/src/server/request/dump.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::sync::Arc;

use futures::sink::SinkExt;
use tokio_util::codec::{Framed, LinesCodec};
use tokio::net::UnixStream;
use tokio_util::codec::{Framed, LinesCodec};

use persist_core::error::Error;
use persist_core::protocol::{DumpRequest, DumpResponse, Response};
Expand Down
2 changes: 1 addition & 1 deletion persist-daemon/src/server/request/info.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::sync::Arc;

use futures::sink::SinkExt;
use tokio_util::codec::{Framed, LinesCodec};
use tokio::net::UnixStream;
use tokio_util::codec::{Framed, LinesCodec};

use persist_core::error::Error;
use persist_core::protocol::{InfoRequest, InfoResponse, ProcessInfo, ProcessStatus, Response};
Expand Down
2 changes: 1 addition & 1 deletion persist-daemon/src/server/request/list.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::sync::Arc;

use futures::sink::SinkExt;
use tokio_util::codec::{Framed, LinesCodec};
use tokio::net::UnixStream;
use tokio_util::codec::{Framed, LinesCodec};

use persist_core::error::Error;
use persist_core::protocol::{ListRequest, Response};
Expand Down
2 changes: 1 addition & 1 deletion persist-daemon/src/server/request/restart.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::sync::Arc;

use futures::sink::SinkExt;
use tokio_util::codec::{Framed, LinesCodec};
use tokio::net::UnixStream;
use tokio_util::codec::{Framed, LinesCodec};

use persist_core::error::Error;
use persist_core::protocol::{Response, RestartRequest, RestartResponse};
Expand Down
2 changes: 1 addition & 1 deletion persist-daemon/src/server/request/start.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::sync::Arc;

use futures::sink::SinkExt;
use tokio_util::codec::{Framed, LinesCodec};
use tokio::net::UnixStream;
use tokio_util::codec::{Framed, LinesCodec};

use persist_core::daemon::{self, LOGS_DIR, PIDS_DIR};
use persist_core::error::Error;
Expand Down
2 changes: 1 addition & 1 deletion persist-daemon/src/server/request/stop.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::sync::Arc;

use futures::sink::SinkExt;
use tokio_util::codec::{Framed, LinesCodec};
use tokio::net::UnixStream;
use tokio_util::codec::{Framed, LinesCodec};

use persist_core::error::Error;
use persist_core::protocol::{Response, StopRequest, StopResponse};
Expand Down
4 changes: 2 additions & 2 deletions persist-daemon/src/server/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ use futures::stream::StreamExt;
use heim::process::Process;
use heim::units::information::byte;
use heim::units::ratio;
use tokio_util::codec::{FramedRead, FramedWrite, LinesCodec};
use tokio::fs::OpenOptions;
use tokio::process::{Child, Command};
use tokio::sync::Mutex;
use tokio_util::codec::{FramedRead, FramedWrite, LinesCodec};

use persist_core::error::{Error, PersistError};
use persist_core::protocol::{ProcessInfo, ProcessSpec, ProcessStatus, ListResponse};
use persist_core::protocol::{ListResponse, ProcessInfo, ProcessSpec, ProcessStatus};

#[derive(Default)]
pub struct State {
Expand Down
5 changes: 4 additions & 1 deletion persist/src/commands/delete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ pub async fn handle(opts: Opts) -> Result<(), Error> {
let responses = daemon.delete(DeleteRequest { filters }).await?;
for response in responses {
if let Some(error) = response.error {
let msg = format!("process '{}' could not be deleted: {}", response.name, error);
let msg = format!(
"process '{}' could not be deleted: {}",
response.name, error
);
format::error(msg);
} else {
let msg = format!("process '{}' successfully deleted.", response.name);
Expand Down
5 changes: 4 additions & 1 deletion persist/src/commands/restart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ pub async fn handle(opts: Opts) -> Result<(), Error> {
let responses = daemon.restart(request).await?;
for response in responses {
if let Some(error) = response.error {
let msg = format!("process '{}' could not be restarted: {}", response.name, error);
let msg = format!(
"process '{}' could not be restarted: {}",
response.name, error
);
format::error(msg);
} else {
let msg = format!("process '{}' successfully restarted.", response.name);
Expand Down
5 changes: 4 additions & 1 deletion persist/src/commands/stop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ pub async fn handle(opts: Opts) -> Result<(), Error> {

for response in responses {
if let Some(error) = response.error {
let msg = format!("process '{}' could not be stopped: {}", response.name, error);
let msg = format!(
"process '{}' could not be stopped: {}",
response.name, error
);
format::error(msg);
} else {
let msg = format!("process '{}' successfully stopped.", response.name);
Expand Down
2 changes: 1 addition & 1 deletion persist/src/daemon/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use std::path::Path;

use futures::sink::SinkExt;
use futures::stream::StreamExt;
use tokio_util::codec::{Framed, LinesCodec};
use tokio::net::UnixStream;
use tokio_util::codec::{Framed, LinesCodec};

use persist_core::error::Error;
use persist_core::protocol::*;
Expand Down

0 comments on commit 52fddd4

Please sign in to comment.