Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings #140

Merged
merged 1 commit into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/chat/chat_history_card.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::{
data::{chats::chat::ChatID, store::Store},
shared::portal::PortalAction,
};
use chrono::{DateTime, Local, NaiveDateTime, TimeZone};
use chrono::{DateTime, Local, TimeZone};

use makepad_widgets::*;

Expand Down Expand Up @@ -165,10 +165,10 @@ impl Widget for ChatHistoryCard {

// Format date.
// TODO: Feels wrong to asume the id will always be the date, do smth about this.
let naive_datetime = NaiveDateTime::from_timestamp_millis(chat.borrow().id as i64)
let datetime = DateTime::from_timestamp_millis(chat.borrow().id as i64)
.expect("Invalid timestamp");
let datetime: DateTime<Local> = Local.from_utc_datetime(&naive_datetime);
let formatted_date = datetime.format("%-I:%M %p, %-d/%m/%y").to_string();
let local_datetime: DateTime<Local> = Local.from_utc_datetime(&datetime.naive_utc());
let formatted_date = local_datetime.format("%-I:%M %p, %-d/%m/%y").to_string();

date_label.set_text(&formatted_date);

Expand Down
1 change: 0 additions & 1 deletion src/chat/delete_chat_modal.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use makepad_widgets::*;

use crate::{
chat::chat_panel::ChatPanelAction,
data::{chats::chat::ChatID, store::Store},
shared::portal::PortalAction,
};
Expand Down
1 change: 0 additions & 1 deletion src/data/chats/chat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ impl Chat {
break;
}
Err(err) => eprintln!("Error receiving response chunk: {:?}", err),
_ => (),
}
} else {
break;
Expand Down
1 change: 0 additions & 1 deletion src/data/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use chrono::{DateTime, Utc};
use makepad_widgets::{DefaultNone, SignalToUI};
use moxin_backend::Backend;
use moxin_protocol::data::{Author, DownloadedFile, File, FileID, Model, ModelID, PendingDownload};
use std::path::PathBuf;
use std::rc::Rc;

pub const DEFAULT_MAX_DOWNLOAD_THREADS: usize = 3;
Expand Down
2 changes: 1 addition & 1 deletion src/my_models/my_models_screen.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use makepad_widgets::*;
use moxin_protocol::data::DownloadedFile;
use moxin_protocol::protocol::Command;
use std::path::{Path, PathBuf};
use std::path::PathBuf;

use crate::{data::store::Store, shared::utils::BYTES_PER_MB};

Expand Down
1 change: 0 additions & 1 deletion src/shared/portal.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use std::any::Any;
use std::fmt::Debug;

use makepad_widgets::*;
Expand Down