Skip to content

Commit

Permalink
Update application version
Browse files Browse the repository at this point in the history
  • Loading branch information
YannikSc committed Apr 7, 2021
1 parent 1182d65 commit e8e623c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rustgen"
version = "0.2.3"
version = "0.2.4"
authors = ["Yannik <[email protected]>"]
description = "A Rust Code-Generator"
edition = "2018"
Expand Down
20 changes: 16 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ extern crate handlebars;
extern crate serde;
extern crate serde_yaml;

use std::{env, fs};
use std::collections::{BTreeMap, HashMap};
use std::path::PathBuf;
use std::{env, fs};

use crate::console::get_arguments;
use crate::rustgen_error::{RustgenError, RustgenResult};
Expand All @@ -24,9 +24,21 @@ fn insert_default_data(defaults: &HashMap<String, String>, data: &mut BTreeMap<S
}

fn generate(named: HashMap<String, String>, mapped: HashMap<String, String>) -> RustgenResult<()> {
let t_type = String::from(mapped.get("type").ok_or(RustgenError::new("Missing parameter 'type'"))?);
let action = String::from(mapped.get("action").ok_or(RustgenError::new("Missing parameter 'action'"))?);
let name = String::from(mapped.get("name").ok_or(RustgenError::new("Missing parameter 'name'"))?);
let t_type = String::from(
mapped
.get("type")
.ok_or(RustgenError::new("Missing parameter 'type'"))?,
);
let action = String::from(
mapped
.get("action")
.ok_or(RustgenError::new("Missing parameter 'action'"))?,
);
let name = String::from(
mapped
.get("name")
.ok_or(RustgenError::new("Missing parameter 'name'"))?,
);
let mut data = BTreeMap::<String, String>::new();
let config = config::read();
insert_default_data(&config.default, &mut data);
Expand Down

0 comments on commit e8e623c

Please sign in to comment.