Fixed diesel warnings
This commit is contained in:
parent
65f3e268dc
commit
e079574879
3 changed files with 12 additions and 12 deletions
|
@ -155,8 +155,8 @@ pub fn amend<T>(db: &T, new_config: &Config) -> Result<()>
|
||||||
if let Some(ref mount_dirs) = new_config.mount_dirs {
|
if let Some(ref mount_dirs) = new_config.mount_dirs {
|
||||||
diesel::delete(mount_points::table)
|
diesel::delete(mount_points::table)
|
||||||
.execute(connection.deref())?;
|
.execute(connection.deref())?;
|
||||||
diesel::insert(mount_dirs)
|
diesel::insert_into(mount_points::table)
|
||||||
.into(mount_points::table)
|
.values(mount_dirs)
|
||||||
.execute(connection.deref())?;
|
.execute(connection.deref())?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,8 +184,8 @@ pub fn amend<T>(db: &T, new_config: &Config) -> Result<()>
|
||||||
.collect::<_>();
|
.collect::<_>();
|
||||||
for ref config_user in insert_users {
|
for ref config_user in insert_users {
|
||||||
let new_user = User::new(&config_user.name, &config_user.password, config_user.admin);
|
let new_user = User::new(&config_user.name, &config_user.password, config_user.admin);
|
||||||
diesel::insert(&new_user)
|
diesel::insert_into(users::table)
|
||||||
.into(users::table)
|
.values(&new_user)
|
||||||
.execute(connection.deref())?;
|
.execute(connection.deref())?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -124,8 +124,8 @@ impl<'conn> IndexBuilder<'conn> {
|
||||||
let connection = connection.deref();
|
let connection = connection.deref();
|
||||||
connection
|
connection
|
||||||
.transaction::<_, Error, _>(|| {
|
.transaction::<_, Error, _>(|| {
|
||||||
diesel::insert(&self.new_songs)
|
diesel::insert_into(songs::table)
|
||||||
.into(songs::table)
|
.values(&self.new_songs)
|
||||||
.execute(connection)?;
|
.execute(connection)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
})?;
|
})?;
|
||||||
|
@ -138,8 +138,8 @@ impl<'conn> IndexBuilder<'conn> {
|
||||||
let connection = connection.deref();
|
let connection = connection.deref();
|
||||||
connection
|
connection
|
||||||
.transaction::<_, Error, _>(|| {
|
.transaction::<_, Error, _>(|| {
|
||||||
diesel::insert(&self.new_directories)
|
diesel::insert_into(directories::table)
|
||||||
.into(directories::table)
|
.values(&self.new_directories)
|
||||||
.execute(connection)?;
|
.execute(connection)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
})?;
|
})?;
|
||||||
|
|
|
@ -101,8 +101,8 @@ pub fn save_playlist<T>(playlist_name: &str,
|
||||||
owner: user.id,
|
owner: user.id,
|
||||||
};
|
};
|
||||||
|
|
||||||
diesel::insert(&new_playlist)
|
diesel::insert_into(playlists::table)
|
||||||
.into(playlists::table)
|
.values(&new_playlist)
|
||||||
.execute(connection.deref())?;
|
.execute(connection.deref())?;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -140,8 +140,8 @@ pub fn save_playlist<T>(playlist_name: &str,
|
||||||
diesel::delete(old_songs).execute(connection.deref())?;
|
diesel::delete(old_songs).execute(connection.deref())?;
|
||||||
|
|
||||||
// Insert content
|
// Insert content
|
||||||
diesel::insert(&new_songs)
|
diesel::insert_into(playlist_songs::table)
|
||||||
.into(playlist_songs::table)
|
.values(&new_songs)
|
||||||
.execute(connection.deref())?;
|
.execute(connection.deref())?;
|
||||||
Ok(())
|
Ok(())
|
||||||
})?;
|
})?;
|
||||||
|
|
Loading…
Add table
Reference in a new issue