Compare commits

..

2 Commits

Author SHA1 Message Date
cuddle-please
849bc8a5f2 chore(release): 0.2.1
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-09-15 20:13:22 +00:00
c2dfd020bf chore: cleanup warnings
All checks were successful
continuous-integration/drone/push Build is passing
2024-09-15 22:12:42 +02:00
4 changed files with 7 additions and 14 deletions

View File

@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- implement naive fuzzy matcher - implement naive fuzzy matcher
### Other ### Other
- cleanup warnings
- move fuzzy search out of command - move fuzzy search out of command
- refactor/matcher move to a separate file - refactor/matcher move to a separate file

View File

@ -1,5 +1,3 @@
use nucleo_matcher::{pattern::Pattern, Matcher, Utf32Str};
use crate::{ use crate::{
app::App, cache::CacheApp, fuzzy_matcher::FuzzyMatcherApp, projects_list::ProjectsListApp, app::App, cache::CacheApp, fuzzy_matcher::FuzzyMatcherApp, projects_list::ProjectsListApp,
}; };
@ -55,11 +53,11 @@ impl RootCommand {
} }
trait StringExt { trait StringExt {
fn as_str_vec<'a>(&'a self) -> Vec<&'a str>; fn as_str_vec(&self) -> Vec<&str>;
} }
impl StringExt for Vec<String> { impl StringExt for Vec<String> {
fn as_str_vec<'a>(&'a self) -> Vec<&'a str> { fn as_str_vec(&self) -> Vec<&str> {
self.iter().map(|r| r.as_ref()).collect() self.iter().map(|r| r.as_ref()).collect()
} }
} }

View File

@ -11,7 +11,7 @@ impl FuzzyMatcher {
pub fn match_pattern<'a>(&self, pattern: &'a str, items: &'a [&'a str]) -> Vec<&'a str> { pub fn match_pattern<'a>(&self, pattern: &'a str, items: &'a [&'a str]) -> Vec<&'a str> {
let pat = Pattern::new( let pat = Pattern::new(
&pattern, pattern,
nucleo_matcher::pattern::CaseMatching::Ignore, nucleo_matcher::pattern::CaseMatching::Ignore,
nucleo_matcher::pattern::Normalization::Smart, nucleo_matcher::pattern::Normalization::Smart,
nucleo_matcher::pattern::AtomKind::Fuzzy, nucleo_matcher::pattern::AtomKind::Fuzzy,
@ -19,7 +19,7 @@ impl FuzzyMatcher {
let mut matcher = Matcher::new(nucleo_matcher::Config::DEFAULT); let mut matcher = Matcher::new(nucleo_matcher::Config::DEFAULT);
let res = pat.match_list(items, &mut matcher); let res = pat.match_list(items, &mut matcher);
res.into_iter().map(|((item, _))| *item).collect::<Vec<_>>() res.into_iter().map(|(item, _)| *item).collect::<Vec<_>>()
} }
} }

View File

@ -1,10 +1,4 @@
use anyhow::Context; use octocrab::{models::Repository, params::repos::Sort, Octocrab, Page};
use octocrab::{
auth::Auth,
models::{hooks::Config, Repository},
params::repos::Sort,
NoSvc, Octocrab, Page,
};
use crate::{app::App, config::GitHubAccessToken}; use crate::{app::App, config::GitHubAccessToken};
@ -159,7 +153,7 @@ impl GitHubProvider {
fn get_client( fn get_client(
&self, &self,
url: Option<&String>, _url: Option<&String>,
access_token: &GitHubAccessToken, access_token: &GitHubAccessToken,
) -> anyhow::Result<Octocrab> { ) -> anyhow::Result<Octocrab> {
let client = octocrab::Octocrab::builder() let client = octocrab::Octocrab::builder()