~savoy/mailcap

35810c6616044908b33e1351beec9cd899df1051 — savoy 2 years ago 951391d
bool fields for Entry are no longer Option<>

Signed-off-by: savoy <git@liberation.red>
1 files changed, 9 insertions(+), 9 deletions(-)

M src/lib.rs
M src/lib.rs => src/lib.rs +9 -9
@@ 45,9 45,9 @@ pub struct Entry {
    note: Option<String>,
    description: Option<String>,
    name_template: Option<String>,
    needs_terminal: Option<bool>,
    copious_output: Option<bool>,
    textual_new_lines: Option<bool>, // either 1 or 0 in file
    needs_terminal: bool,
    copious_output: bool,
    textual_new_lines: bool, // either 1 or 0 in file
}

fn get_user_home() -> PathBuf {


@@ 193,9 193,9 @@ impl Entry {
                Some(("note", v)) => entry.note = Some(v[1..].to_string()),
                Some(("description", v)) => entry.description = Some(v[1..].to_string()),
                Some(("nametemplate", v)) => entry.name_template = Some(v[1..].to_string()),
                Some(("needsterminal", _)) => entry.needs_terminal = Some(true),
                Some(("copiousoutput", _)) => entry.copious_output = Some(true),
                Some(("textualnewlines", _)) => entry.textual_new_lines = Some(true),
                Some(("needsterminal", _)) => entry.needs_terminal = true,
                Some(("copiousoutput", _)) => entry.copious_output = true,
                Some(("textualnewlines", _)) => entry.textual_new_lines = true,
                _ => continue,
            }
        }


@@ 319,9 319,9 @@ mod tests {
                note: None,
                description: None,
                name_template: Some("%s.html".to_string()),
                needs_terminal: Some(true),
                copious_output: None,
                textual_new_lines: Some(true)
                needs_terminal: true,
                copious_output: false,
                textual_new_lines: true
            },
            entry
        )