mirror of
https://github.com/zaphar/kitchen.git
synced 2025-07-22 19:40:14 -04:00
Remove the unnecessary api module
This commit is contained in:
parent
8c142711bc
commit
81b5cdbf57
@ -1,31 +0,0 @@
|
||||
// Copyright 2022 Jeremy Wall
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum ParseError {
|
||||
IO(std::io::Error),
|
||||
Syntax(String),
|
||||
}
|
||||
|
||||
impl From<std::io::Error> for ParseError {
|
||||
fn from(err: std::io::Error) -> Self {
|
||||
ParseError::IO(err)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<String> for ParseError {
|
||||
fn from(s: String) -> Self {
|
||||
ParseError::Syntax(s)
|
||||
}
|
||||
}
|
@ -19,10 +19,26 @@ use std::path::Path;
|
||||
|
||||
use csv;
|
||||
|
||||
use crate::api::ParseError;
|
||||
use recipes::{parse, IngredientAccumulator, Recipe};
|
||||
use tracing::{error, info, instrument, warn};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum ParseError {
|
||||
IO(std::io::Error),
|
||||
Syntax(String),
|
||||
}
|
||||
|
||||
impl From<std::io::Error> for ParseError {
|
||||
fn from(err: std::io::Error) -> Self {
|
||||
ParseError::IO(err)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<String> for ParseError {
|
||||
fn from(s: String) -> Self {
|
||||
ParseError::Syntax(s)
|
||||
}
|
||||
}
|
||||
// TODO(jwall): We should think a little more closely about
|
||||
// the error modeling for this application.
|
||||
macro_rules! try_open {
|
||||
|
@ -22,7 +22,6 @@ use clap::{clap_app, crate_authors, crate_version};
|
||||
use tracing::{error, info, instrument, warn, Level};
|
||||
use tracing_subscriber::FmtSubscriber;
|
||||
|
||||
pub mod api;
|
||||
mod cli;
|
||||
mod web;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user