Thanks, clippy

This commit is contained in:
Vivianne 2023-06-26 18:37:00 -07:00
parent b98e2abab6
commit 6bdc45fcd3

View file

@ -37,7 +37,7 @@ pub fn create_library(conn: &mut SqliteConnection, name: &str) -> Library {
.expect("Error saving new post") .expect("Error saving new post")
} }
pub fn get_tag<'a>(conn: &mut SqliteConnection, tag: &'a str) -> Option<Tag> { pub fn get_tag(conn: &mut SqliteConnection, tag: &str) -> Option<Tag> {
use crate::schema::tags::dsl::*; use crate::schema::tags::dsl::*;
tags.filter(name.eq(&tag)) tags.filter(name.eq(&tag))
.select(Tag::as_select()) .select(Tag::as_select())
@ -52,7 +52,7 @@ pub fn list_tags(conn: &mut SqliteConnection) -> Vec<Tag> {
.expect("can't list tags") .expect("can't list tags")
} }
pub fn samples_with_tag<'a>(conn: &mut SqliteConnection, tag: &'a str) -> Vec<Sample> { pub fn samples_with_tag(conn: &mut SqliteConnection, tag: &str) -> Vec<Sample> {
let tag = get_tag(conn, tag).expect("Expected tag to exist..."); let tag = get_tag(conn, tag).expect("Expected tag to exist...");
let sample_ids = SampleTag::belonging_to(&tag).select(schema::samples_tags::sample_id); let sample_ids = SampleTag::belonging_to(&tag).select(schema::samples_tags::sample_id);