Skip to content

Commit

Permalink
rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
ddboline committed Nov 24, 2024
1 parent e5df14d commit 313df2d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
12 changes: 6 additions & 6 deletions diary_app_api/src/logged_user.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pub use authorized_users::{
get_random_key, get_secrets, token::Token, AuthorizedUser, AUTHORIZED_USERS, JWT_SECRET,
KEY_LENGTH, LOGIN_HTML, SECRET_KEY, TRIGGER_DB_UPDATE, AuthorizedUser as ExternalUser
get_random_key, get_secrets, token::Token, AuthorizedUser as ExternalUser, AUTHORIZED_USERS,
JWT_SECRET, KEY_LENGTH, LOGIN_HTML, SECRET_KEY, TRIGGER_DB_UPDATE,
};
use futures::TryStreamExt;
use log::debug;
Expand All @@ -10,13 +10,13 @@ use rweb_helper::UuidWrapper;
use serde::{Deserialize, Serialize};
use stack_string::StackString;
use std::{
collections::HashMap,
convert::{TryFrom, TryInto},
env::var,
str::FromStr,
collections::HashMap,
};
use uuid::Uuid;
use time::OffsetDateTime;
use uuid::Uuid;

use diary_app_lib::{models::AuthorizedUsers, pgpool::PgPool};

Expand Down Expand Up @@ -54,8 +54,8 @@ impl LoggedUser {
}
}

impl From<AuthorizedUser> for LoggedUser {
fn from(user: AuthorizedUser) -> Self {
impl From<ExternalUser> for LoggedUser {
fn from(user: ExternalUser) -> Self {
Self {
email: user.email,
session: user.session.into(),
Expand Down
3 changes: 1 addition & 2 deletions diary_app_lib/src/diary_app_interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,7 @@ impl DiaryAppInterface {
let result = if diary_file.exists() {
let mut f = OpenOptions::new().append(true).open(&diary_file).await?;
let entry_text = format_sstr!("\n\n{}\n\n", entry_string);
f.write_all(entry_text.as_bytes())
.await?;
f.write_all(entry_text.as_bytes()).await?;
None
} else if let Some(mut current_entry) =
DiaryEntries::get_by_date(entry_date, &self.pool).await?
Expand Down
3 changes: 1 addition & 2 deletions diary_app_lib/src/local_interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ impl LocalInterface {
.await?
.ok_or_else(|| format_err!("Date should exist {date}"))?;
let entry_text = format_sstr!("{date}\n\n{t}\n\n", t = entry.diary_text);
f.write_all(entry_text.as_bytes())
.await?;
f.write_all(entry_text.as_bytes()).await?;
}
Ok(format_sstr!("{year} {l}", l = date_list.len()))
}
Expand Down

0 comments on commit 313df2d

Please sign in to comment.