Better rustfmt
This commit is contained in:
parent
afa748c08c
commit
fd18f67e43
|
@ -0,0 +1,15 @@
|
|||
name: Rustfmt
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Install rustfmt
|
||||
run: rustup component add rustfmt
|
||||
- name: Check style
|
||||
run: cargo fmt --all -- --check --config=merge_imports=true
|
|
@ -6,22 +6,24 @@ extern crate crossbeam;
|
|||
extern crate regex;
|
||||
extern crate structopt;
|
||||
|
||||
use std::fmt::Debug;
|
||||
use std::io::prelude::*;
|
||||
use std::{fmt::Debug, io::prelude::*};
|
||||
|
||||
use async_std::io::Read;
|
||||
use async_std::net::{TcpStream, UdpSocket};
|
||||
use async_std::{
|
||||
io::Read,
|
||||
net::{TcpStream, UdpSocket},
|
||||
};
|
||||
|
||||
use kuska_handshake::async_std::{handshake_client, BoxStream};
|
||||
use kuska_ssb::api::{
|
||||
dto::{CreateHistoryStreamIn, CreateStreamIn, LatestOut, WhoAmIOut},
|
||||
ApiCaller,
|
||||
use kuska_ssb::{
|
||||
api::{
|
||||
dto::{CreateHistoryStreamIn, CreateStreamIn, LatestOut, WhoAmIOut},
|
||||
ApiCaller,
|
||||
},
|
||||
discovery::ssb_net_id,
|
||||
feed::{is_privatebox, privatebox_decipher, Feed, Message},
|
||||
keystore::{from_patchwork_local, OwnedIdentity},
|
||||
rpc::{RecvMsg, RequestNo, RpcReader, RpcWriter},
|
||||
};
|
||||
use kuska_ssb::discovery::ssb_net_id;
|
||||
use kuska_ssb::feed::{is_privatebox, privatebox_decipher, Feed, Message};
|
||||
use kuska_ssb::keystore::from_patchwork_local;
|
||||
use kuska_ssb::keystore::OwnedIdentity;
|
||||
use kuska_ssb::rpc::{RecvMsg, RequestNo, RpcReader, RpcWriter};
|
||||
|
||||
use regex::Regex;
|
||||
use sodiumoxide::crypto::sign::ed25519;
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
use crate::feed::Message;
|
||||
use crate::rpc::{Body, BodyType, RequestNo, RpcType, RpcWriter};
|
||||
use crate::{
|
||||
feed::Message,
|
||||
rpc::{Body, BodyType, RequestNo, RpcType, RpcWriter},
|
||||
};
|
||||
use async_std::io::Write;
|
||||
|
||||
use super::dto;
|
||||
use super::error::Result;
|
||||
use super::{dto, error::Result};
|
||||
|
||||
const MAX_RPC_BODY_LEN: usize = 65536;
|
||||
|
||||
|
|
|
@ -5,5 +5,4 @@ pub use error::{Error, Result};
|
|||
pub use sodium::{
|
||||
ToSodiumObject, ToSsbId, CURVE_ED25519_SUFFIX, ED25519_SIGNATURE_SUFFIX, SHA256_SUFFIX,
|
||||
};
|
||||
pub use sodiumoxide::crypto::hash::sha256;
|
||||
pub use sodiumoxide::crypto::sign::ed25519;
|
||||
pub use sodiumoxide::crypto::{hash::sha256, sign::ed25519};
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
use sodiumoxide::crypto::hash::sha256;
|
||||
use sodiumoxide::crypto::sign::ed25519;
|
||||
use sodiumoxide::crypto::{hash::sha256, sign::ed25519};
|
||||
|
||||
use super::error::{Error, Result};
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ use async_std::net::{IpAddr, SocketAddr, UdpSocket};
|
|||
use once_cell::sync::Lazy;
|
||||
use regex::Regex;
|
||||
|
||||
use crate::{crypto::ed25519, crypto::ToSodiumObject};
|
||||
use crate::crypto::{ed25519, ToSodiumObject};
|
||||
|
||||
use super::error::{Error, Result};
|
||||
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
use serde_json::Value;
|
||||
|
||||
use super::error::{Error, Result};
|
||||
use super::message::Message;
|
||||
use super::ssb_sha256;
|
||||
use std::time::SystemTime;
|
||||
use std::time::UNIX_EPOCH;
|
||||
use super::{
|
||||
error::{Error, Result},
|
||||
message::Message,
|
||||
ssb_sha256,
|
||||
};
|
||||
use std::time::{SystemTime, UNIX_EPOCH};
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct Feed {
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
use std::str::FromStr;
|
||||
use std::time::SystemTime;
|
||||
use std::{str::FromStr, time::SystemTime};
|
||||
|
||||
use serde_json::Value;
|
||||
use sodiumoxide::crypto::sign::ed25519;
|
||||
|
||||
use super::error::{Error, Result};
|
||||
use super::{ssb_sha256, stringify_json};
|
||||
use crate::crypto::ToSodiumObject;
|
||||
use crate::keystore::OwnedIdentity;
|
||||
use super::{
|
||||
error::{Error, Result},
|
||||
ssb_sha256, stringify_json,
|
||||
};
|
||||
use crate::{crypto::ToSodiumObject, keystore::OwnedIdentity};
|
||||
use sodiumoxide::crypto::hash::sha256;
|
||||
|
||||
const MSG_PREVIOUS: &str = "previous";
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
use crate::crypto::ToSodiumObject;
|
||||
|
||||
use sodiumoxide::crypto::sign::SecretKey;
|
||||
use sodiumoxide::crypto::{scalarmult::curve25519, secretbox, sign::ed25519};
|
||||
use sodiumoxide::crypto::{
|
||||
scalarmult::curve25519,
|
||||
secretbox,
|
||||
sign::{ed25519, SecretKey},
|
||||
};
|
||||
|
||||
use super::error::{Error, Result};
|
||||
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
use async_std::io::{Read, Write};
|
||||
use async_std::prelude::*;
|
||||
use async_std::{
|
||||
io::{Read, Write},
|
||||
prelude::*,
|
||||
};
|
||||
|
||||
use std::string::ToString;
|
||||
|
||||
use super::error::{Error, Result};
|
||||
use super::OwnedIdentity;
|
||||
use super::{
|
||||
error::{Error, Result},
|
||||
OwnedIdentity,
|
||||
};
|
||||
use crate::crypto::{ToSodiumObject, ToSsbId};
|
||||
use serde_json::to_vec_pretty;
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
use super::error::{Error, Result};
|
||||
|
||||
use async_std::io;
|
||||
use async_std::prelude::*;
|
||||
use async_std::{io, prelude::*};
|
||||
use log::{trace, warn};
|
||||
|
||||
use async_stream::stream;
|
||||
|
|
Loading…
Reference in New Issue