Skip to content

Commit

Permalink
Improved code clarity.
Browse files Browse the repository at this point in the history
  • Loading branch information
andymandias committed Feb 25, 2024
1 parent cd4c50f commit d1de8d2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions data/src/history/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -451,9 +451,9 @@ impl Data {
Exclude::None => true,
Exclude::Smart(seconds) => {
let nick = match source {
message::source::Server::Join(nick) => nick,
message::source::Server::Part(nick) => nick,
message::source::Server::Quit(nick) => nick,
message::source::Server::Join(nick) => nick,
message::source::Server::Part(nick) => nick,
message::source::Server::Quit(nick) => nick,
};

if nick.is_some() {
Expand Down Expand Up @@ -552,10 +552,10 @@ fn smart_filter_message(
seconds: &i64,
most_recent_message_server_time: Option<&DateTime<Utc>>,
) -> bool {
if most_recent_message_server_time.is_some() {
if let Some(server_time) = most_recent_message_server_time {
let duration_seconds = message
.server_time
.signed_duration_since(*most_recent_message_server_time.unwrap())
.signed_duration_since(*server_time)
.num_seconds();

duration_seconds > *seconds
Expand Down

0 comments on commit d1de8d2

Please sign in to comment.