From a3eaa8611425c87ef940215650bad6668464c301 Mon Sep 17 00:00:00 2001
From: KunoiSayami <46131041+KunoiSayami@users.noreply.github.com>
Date: Sat, 8 May 2021 01:24:07 +0800
Subject: style: Address cargo fmt
---
src/datastructures.rs | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
(limited to 'src/datastructures.rs')
diff --git a/src/datastructures.rs b/src/datastructures.rs
index b920eb4..0438b70 100644
--- a/src/datastructures.rs
+++ b/src/datastructures.rs
@@ -18,12 +18,12 @@
** along with this program. If not, see .
*/
-use sha2::Digest;
use anyhow::Result;
-use url::form_urlencoded;
+use sha2::Digest;
use std::borrow::Cow;
-use std::path::Path;
use std::fs::read_to_string;
+use std::path::Path;
+use url::form_urlencoded;
const DEFAULT_CONFIG_LOCATION: &str = "/etc/cgitrc";
const DEFAULT_COOKIE_TTL: u64 = 1200;
@@ -56,10 +56,9 @@ impl Config {
let mut cookie_ttl: u64 = DEFAULT_COOKIE_TTL;
let mut database: &str = "/etc/cgit/auth.db";
for line in file.lines() {
-
let line = line.trim();
if !line.contains('=') || !line.starts_with("cgit-simple-auth-") {
- continue
+ continue;
}
let (key, value) = if line.contains('#') {
@@ -76,7 +75,7 @@ impl Config {
}
Self {
cookie_ttl,
- database: database.to_string()
+ database: database.to_string(),
}
}
@@ -85,7 +84,6 @@ impl Config {
}
}
-
#[derive(Debug, Clone, Default)]
pub struct FormData {
user: String,
@@ -95,7 +93,9 @@ pub struct FormData {
impl FormData {
pub fn new() -> Self {
- Self { ..Default::default()}
+ Self {
+ ..Default::default()
+ }
}
pub fn get_string_sha256_value(s: &str) -> Result {
@@ -165,4 +165,4 @@ impl From for FormData {
fn from(s: String) -> Self {
Self::from(&s)
}
-}
\ No newline at end of file
+}
--
cgit v1.3.1