refactor: rename gc info grand_company field to name

This commit is contained in:
Anna 2018-09-11 01:15:40 -04:00
parent 09e429984f
commit a0dd920b74
2 changed files with 3 additions and 3 deletions

View File

@ -67,14 +67,14 @@ crate fn parse_grand_company(text: &str) -> Result<GrandCompanyInfo> {
let gc_str = x
.next()
.ok_or_else(|| Error::invalid_content("gc/rank separated by `/`", Some(&text)))?;
let grand_company = GrandCompany::parse(gc_str)
let name = GrandCompany::parse(gc_str)
.ok_or_else(|| Error::invalid_content("valid grand company", Some(&text)))?;
let rank = x
.next()
.ok_or_else(|| Error::invalid_content("gc/rank separated by `/`", Some(&text)))?
.to_string();
Ok(GrandCompanyInfo {
grand_company,
name,
rank,
})
}

View File

@ -37,7 +37,7 @@ pub struct Character {
#[derive(Debug, Serialize, Deserialize)]
pub struct GrandCompanyInfo {
pub grand_company: GrandCompany,
pub name: GrandCompany,
pub rank: String,
}