Skip to content
This repository has been archived by the owner on Jul 26, 2024. It is now read-only.

Commit

Permalink
feat: Optimize reading from stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzaaft committed Jul 18, 2023
1 parent d38d4e4 commit 88d3b7a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 1 addition & 2 deletions src/fzf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ impl Fzf {
) -> Result<Vec<PluginInfo>> {
let selected_plugins = self
.read_from_stdout()?
.split('\n')
.filter(|line| !line.is_empty())
.lines()
.map(|line| {
possible_plugins
.iter()
Expand Down
1 change: 0 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ async fn main() -> Result<()> {
let plugins = astro.get_plugins()?;
dbg!(plugins.len());
let mut fzf = fzf::Fzf::new()?;
let fzf_string: String = plugins.iter().map(|plugin| plugin.to_string()).join("\n");
fzf.write_to_stdin(&plugins)?;
let selected_plugins = fzf.get_selected_plugins(&plugins)?;
let mut import_statement = String::with_capacity(50 * selected_plugins.len());
Expand Down

0 comments on commit 88d3b7a

Please sign in to comment.