Compare commits

..

1 Commits

Author SHA1 Message Date
cuddle-please
6ce5ef7d79 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:09:11 +00:00
4 changed files with 14 additions and 7 deletions

View File

@ -12,7 +12,6 @@ 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,3 +1,5 @@
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,
}; };
@ -53,11 +55,11 @@ impl RootCommand {
} }
trait StringExt { trait StringExt {
fn as_str_vec(&self) -> Vec<&str>; fn as_str_vec<'a>(&'a self) -> Vec<&'a str>;
} }
impl StringExt for Vec<String> { impl StringExt for Vec<String> {
fn as_str_vec(&self) -> Vec<&str> { fn as_str_vec<'a>(&'a self) -> Vec<&'a 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,4 +1,10 @@
use octocrab::{models::Repository, params::repos::Sort, Octocrab, Page}; use anyhow::Context;
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};
@ -153,7 +159,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()