mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
fix clippy lints
This commit is contained in:
parent
b55fd93cab
commit
3923f56cbf
3 changed files with 4 additions and 6 deletions
|
@ -330,7 +330,7 @@ impl Collection {
|
|||
Ok(self.storage.get_note(nid)?.unwrap())
|
||||
}
|
||||
// other errors are unhandled
|
||||
_ => return Err(err),
|
||||
_ => Err(err),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -133,9 +133,7 @@ impl SqlWriter<'_> {
|
|||
SearchNode::EditedInDays(days) => self.write_edited(*days)?,
|
||||
SearchNode::CardTemplate(template) => match template {
|
||||
TemplateKind::Ordinal(_) => self.write_template(template)?,
|
||||
TemplateKind::Name(name) => {
|
||||
self.write_template(&TemplateKind::Name(norm(name).into()))?
|
||||
}
|
||||
TemplateKind::Name(name) => self.write_template(&TemplateKind::Name(norm(name)))?,
|
||||
},
|
||||
SearchNode::Deck(deck) => self.write_deck(&norm(deck))?,
|
||||
SearchNode::NoteTypeID(ntid) => {
|
||||
|
@ -191,7 +189,7 @@ impl SqlWriter<'_> {
|
|||
}
|
||||
|
||||
fn write_tag(&mut self, text: &str) -> Result<()> {
|
||||
if text.contains(" ") {
|
||||
if text.contains(' ') {
|
||||
write!(self.sql, "false").unwrap();
|
||||
} else {
|
||||
match text {
|
||||
|
|
|
@ -298,7 +298,7 @@ pub(crate) fn to_custom_re<'a>(txt: &'a str, wildcard: &str) -> Cow<'a, str> {
|
|||
}
|
||||
|
||||
/// Convert to SQL respecting Anki wildcards.
|
||||
pub(crate) fn to_sql<'a>(txt: &'a str) -> Cow<'a, str> {
|
||||
pub(crate) fn to_sql(txt: &str) -> Cow<str> {
|
||||
// escape sequences and unescaped special characters which need conversion
|
||||
lazy_static! {
|
||||
static ref RE: Regex = Regex::new(r"\\[\\*]|[*%]").unwrap();
|
||||
|
|
Loading…
Reference in a new issue