diff options
| author | jan <jan@ruken.pw> | 2016-10-01 17:21:51 (UTC) |
|---|---|---|
| committer | jan <jan@ruken.pw> | 2016-10-01 17:21:51 (UTC) |
| commit | 463513b6c24d2a261413879233b3b66d1a303659 (patch) | |
| tree | 17863e072b04974befd85aa266572845cc68a369 /src | |
| parent | 6269372d8f4fc893d1679e6c56d66aefe24c6588 (diff) | |
yay
Diffstat (limited to 'src')
| -rw-r--r-- | src/character.rs | 3 | ||||
| -rw-r--r-- | src/main.rs | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/character.rs b/src/character.rs index c1d3829..489588e 100644 --- a/src/character.rs +++ b/src/character.rs | |||
| @@ -35,7 +35,6 @@ pub struct Character { | |||
| 35 | pub tags: Vec<Tag>, | 35 | pub tags: Vec<Tag>, |
| 36 | pub traits: Traits, | 36 | pub traits: Traits, |
| 37 | pub assignments: Vec<u32>, | 37 | pub assignments: Vec<u32>, |
| 38 | pub chars_similar_traits: Vec<u32>, | ||
| 39 | pub extra: Vec<DLListItem>, | 38 | pub extra: Vec<DLListItem>, |
| 40 | 39 | ||
| 41 | pub role: Option<String>, | 40 | pub role: Option<String>, |
| @@ -67,7 +66,6 @@ impl Character { | |||
| 67 | tags: vec![], | 66 | tags: vec![], |
| 68 | traits: Traits::new(), | 67 | traits: Traits::new(), |
| 69 | assignments: vec![], | 68 | assignments: vec![], |
| 70 | chars_similar_traits: vec![], | ||
| 71 | extra: vec![], | 69 | extra: vec![], |
| 72 | role: None | 70 | role: None |
| 73 | } | 71 | } |
| @@ -104,7 +102,6 @@ impl Character { | |||
| 104 | self.traits.indexed = dl_list::parse(&(§ions["traits"] as &Section).data["indexed_raw".into()]); | 102 | self.traits.indexed = dl_list::parse(&(§ions["traits"] as &Section).data["indexed_raw".into()]); |
| 105 | 103 | ||
| 106 | self.assignments = tiles::parse_tile_link_ids(&(§ions["assignments"] as &Section).data["raw".into()], "series"); | 104 | self.assignments = tiles::parse_tile_link_ids(&(§ions["assignments"] as &Section).data["raw".into()], "series"); |
| 107 | self.chars_similar_traits = tiles::parse_tile_link_ids(&(§ions["chars_similar_traits"] as &Section).data["raw".into()], "character"); | ||
| 108 | 105 | ||
| 109 | if misc.data["role".into()].len() > 0 { | 106 | if misc.data["role".into()].len() > 0 { |
| 110 | self.role = Some(misc.data["role".into()].clone()); | 107 | self.role = Some(misc.data["role".into()].clone()); |
diff --git a/src/main.rs b/src/main.rs index a7f1f9d..c91861a 100644 --- a/src/main.rs +++ b/src/main.rs | |||
| @@ -45,7 +45,9 @@ fn main() { | |||
| 45 | 45 | ||
| 46 | let json = serde_json::to_string(&char).unwrap(); | 46 | let json = serde_json::to_string(&char).unwrap(); |
| 47 | 47 | ||
| 48 | let mut o = File::create(out_path.join(entry.file_name())).unwrap(); | 48 | let out_file = out_path.join(entry.file_name().to_str().unwrap().replace("html", "json")); |
| 49 | let mut o = File::create(&out_file).unwrap(); | ||
| 49 | o.write_all(json.as_bytes()).unwrap(); | 50 | o.write_all(json.as_bytes()).unwrap(); |
| 51 | println!("{:?}", out_file); | ||
| 50 | } | 52 | } |
| 51 | } | 53 | } |
