code cleanup, starts testing
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
use crate::schema::{items, looted};
|
||||
use crate::DbConnection;
|
||||
use crate::schema::{looted};
|
||||
use diesel::dsl::{exists, Eq, Filter, Find, Select};
|
||||
use diesel::expression::exists::Exists;
|
||||
use diesel::prelude::*;
|
||||
@@ -60,7 +59,7 @@ type ItemDesc<'a> = (&'a str, i32);
|
||||
/// to the id of buying player otherwise.
|
||||
#[derive(Insertable)]
|
||||
#[table_name = "looted"]
|
||||
struct NewLoot<'a> {
|
||||
pub(crate) struct NewLoot<'a> {
|
||||
name: &'a str,
|
||||
base_price: i32,
|
||||
owner_id: i32,
|
||||
@@ -68,7 +67,7 @@ struct NewLoot<'a> {
|
||||
|
||||
impl<'a> NewLoot<'a> {
|
||||
/// A new loot going to the group (loot procedure)
|
||||
fn to_group(desc: ItemDesc<'a>) -> Self {
|
||||
pub(crate) fn to_group(desc: ItemDesc<'a>) -> Self {
|
||||
Self {
|
||||
name: desc.0,
|
||||
base_price: desc.1,
|
||||
@@ -77,7 +76,7 @@ impl<'a> NewLoot<'a> {
|
||||
}
|
||||
|
||||
/// A new loot going to a specific player (buy procedure)
|
||||
fn to_player(player: i32, desc: ItemDesc<'a>) -> Self {
|
||||
pub(crate) fn to_player(player: i32, desc: ItemDesc<'a>) -> Self {
|
||||
Self {
|
||||
name: desc.0,
|
||||
base_price: desc.1,
|
||||
|
||||
Reference in New Issue
Block a user