chore: format better

This commit is contained in:
sinavir 2024-04-30 18:49:10 +02:00
parent 278025c2e6
commit fc6abbdae3
6 changed files with 28 additions and 21 deletions

3
rustfmt.toml Normal file
View file

@ -0,0 +1,3 @@
unstable_features = true
group_imports = "StdExternalCrate"
imports_granularity = "Module"

View file

@ -1,4 +1,6 @@
{ pkgs ? import (import ./npins).nixpkgs { } }:
{
pkgs ? import (import ./npins).nixpkgs { },
}:
pkgs.mkShell {
buildInputs = [
pkgs.cargo
@ -7,6 +9,6 @@ pkgs.mkShell {
pkgs.signal-cli
pkgs.rustc
pkgs.rust-analyzer
pkgs.rustfmt
(pkgs.rustfmt.override { asNightly = true; })
];
}

View file

@ -1,20 +1,18 @@
mod jsonrpc;
mod transform;
mod transports;
use crate::jsonrpc::RpcClient;
use irc::client::ClientStream;
use jsonrpsee::core::client::SubscriptionClientT;
use log;
use serde_json::Value;
use std::path::Path;
use transform::Bridge;
use jsonrpsee::core::client::Subscription;
use pretty_env_logger;
use futures::future::try_join;
use futures::prelude::*;
use irc::client::prelude::*;
use irc::client::ClientStream;
use jsonrpsee::core::client::{Subscription, SubscriptionClientT};
use serde_json::Value;
use transform::Bridge;
use {log, pretty_env_logger};
use crate::jsonrpc::RpcClient;
const CHANNEL: &str = "#hackens-signal";
const MEDIA_DIR: &str = "./www";
@ -149,7 +147,11 @@ async fn handle_signal(
.map_err(|e| format!("error while sending to irc: {e}"))?;
}
}
Some(Err(err)) => return Err(format!("error while retrieving messages from signal: {err}")),
Some(Err(err)) => {
return Err(format!(
"error while retrieving messages from signal: {err}"
))
}
}
}
}

View file

@ -1,7 +1,7 @@
use irc::client::prelude::*;
use serde_json::Map;
use serde_json::Value;
use std::path::Path;
use irc::client::prelude::*;
use serde_json::{Map, Value};
use tokio::fs::copy;
#[derive(Default)]

View file

@ -15,11 +15,10 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
use futures_util::{stream::StreamExt, Sink, SinkExt, Stream};
use jsonrpsee::core::{
async_trait,
client::{ReceivedMessage, TransportReceiverT, TransportSenderT},
};
use futures_util::stream::StreamExt;
use futures_util::{Sink, SinkExt, Stream};
use jsonrpsee::core::async_trait;
use jsonrpsee::core::client::{ReceivedMessage, TransportReceiverT, TransportSenderT};
use thiserror::Error;
pub mod ipc;

View file

@ -15,8 +15,9 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
use bytes::BytesMut;
use std::{io, str};
use bytes::BytesMut;
use tokio_util::codec::{Decoder, Encoder};
type Separator = u8;