Skip to content
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
2 changes: 1 addition & 1 deletion client/src/component/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fn clipped_title(title: String) -> String {

let mut clipped_title: String = title
.char_indices()
.filter_map(|(_, character)| Some(character))
.map(|(_, character)| character)
.take(57)
.collect();
clipped_title.push_str("...");
Expand Down
7 changes: 3 additions & 4 deletions client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ impl Application for Centerpiece {
iced::font::load(
include_bytes!("../assets/FiraCode/FiraCodeNerdFont-Regular.ttf").as_slice(),
)
.map(|font_loading_result| Message::FontLoaded(font_loading_result)),
.map(Message::FontLoaded),
iced::font::load(
include_bytes!("../assets/FiraCode/FiraCodeNerdFont-Light.ttf").as_slice(),
)
.map(|font_loading_result| Message::FontLoaded(font_loading_result)),
.map(Message::FontLoaded),
iced::Command::perform(async {}, move |()| Message::Loaded),
]),
)
Expand Down Expand Up @@ -385,8 +385,7 @@ impl Centerpiece {
plugin
.entries
.iter()
.find(|entry| entry.id.eq(active_entry_id))
.is_some()
.any(|entry| entry.id.eq(active_entry_id))
})
.unwrap_or(0) as f32,
None => 0.0,
Expand Down
4 changes: 2 additions & 2 deletions client/src/plugin/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ pub trait Plugin {

fn search(
&mut self,
query: &String,
query: &str,
plugin_channel_out: &mut iced::futures::channel::mpsc::Sender<crate::Message>,
) -> anyhow::Result<()> {
let filtered_entries = crate::plugin::utils::search(self.entries(), query);
Expand All @@ -151,7 +151,7 @@ pub trait Plugin {
}
}

pub fn search(entries: Vec<crate::model::Entry>, query: &String) -> Vec<crate::model::Entry> {
pub fn search(entries: Vec<crate::model::Entry>, query: &str) -> Vec<crate::model::Entry> {
if query.is_empty() {
let mut sorted_entries = entries.clone();
sorted_entries.sort_by_key(|entry| entry.title.clone());
Expand Down