makes models and schema modules privates, adds re-exports

This commit is contained in:
2019-02-03 21:12:48 +01:00
parent d3259c82b3
commit b14e566593
6 changed files with 19 additions and 12 deletions

View File

@@ -3,8 +3,9 @@ extern crate diesel;
use std::io::{stdin};
use diesel::SqliteConnection;
use self::cookbook::*;
use self::models::{NewRecipe, fields::RecipeCategory, fields::IngredientList};
use cookbook::*;
use cookbook::recipes::{NewRecipe, RecipeCategory};
use cookbook::ingredients::{IngredientList};
struct CreateRecipe<'a> {
connection: &'a SqliteConnection,
@@ -33,7 +34,7 @@ impl<'a> CreateRecipe<'a> {
fn add_ingredient(&mut self, name: String) {
use crate::ingredients::*;
let name = name.trim();
// Check it exists or create
match get_id_or_create(self.connection, &name) {
Ok(id) => {