mirror of
https://github.com/agersant/polaris
synced 2024-12-04 02:29:11 +00:00
Fixed compiler warnings
This commit is contained in:
parent
6ae9f6b6a0
commit
ce4f9ef87f
2 changed files with 12 additions and 13 deletions
|
@ -575,7 +575,7 @@ fn read_playlist(request: &mut Request, db: &DB) -> IronResult<Response> {
|
|||
|
||||
let playlist_name = match percent_decode(playlist_name.as_bytes()).decode_utf8() {
|
||||
Ok(s) => s,
|
||||
Err(e) => return Err(Error::from(ErrorKind::EncodingError).into()),
|
||||
Err(_) => return Err(Error::from(ErrorKind::EncodingError).into()),
|
||||
};
|
||||
|
||||
let songs = playlist::read_playlist(&playlist_name, &username, db)?;
|
||||
|
@ -602,7 +602,7 @@ fn delete_playlist(request: &mut Request, db: &DB) -> IronResult<Response> {
|
|||
|
||||
let playlist_name = match percent_decode(playlist_name.as_bytes()).decode_utf8() {
|
||||
Ok(s) => s,
|
||||
Err(e) => return Err(Error::from(ErrorKind::EncodingError).into()),
|
||||
Err(_) => return Err(Error::from(ErrorKind::EncodingError).into()),
|
||||
};
|
||||
|
||||
playlist::delete_playlist(&playlist_name, &username, db)?;
|
||||
|
|
|
@ -31,7 +31,6 @@ pub struct User {
|
|||
pub struct Playlist {
|
||||
id: i32,
|
||||
owner: i32,
|
||||
name: String,
|
||||
}
|
||||
|
||||
#[derive(Identifiable, Queryable, Associations)]
|
||||
|
@ -39,8 +38,6 @@ pub struct Playlist {
|
|||
pub struct PlaylistSong {
|
||||
id: i32,
|
||||
playlist: i32,
|
||||
path: String,
|
||||
ordering: i32,
|
||||
}
|
||||
|
||||
#[derive(Insertable)]
|
||||
|
@ -111,6 +108,7 @@ pub fn save_playlist<T>(playlist_name: &str,
|
|||
{
|
||||
use self::playlists::dsl::*;
|
||||
playlist = playlists
|
||||
.select((id, owner))
|
||||
.filter(name.eq(playlist_name).and(owner.eq(user.id)))
|
||||
.get_result(connection.deref())?;
|
||||
}
|
||||
|
@ -176,6 +174,7 @@ pub fn read_playlist<T>(playlist_name: &str, owner: &str, db: &T) -> Result<Vec<
|
|||
{
|
||||
use self::playlists::dsl::*;
|
||||
playlist = playlists
|
||||
.select((id, owner))
|
||||
.filter(name.eq(playlist_name).and(owner.eq(user.id)))
|
||||
.get_result(connection.deref())?;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue