summaryrefslogtreecommitdiffstats
path: root/src/poem/read.rs
diff options
context:
space:
mode:
authorRory Dudley2024-09-02 22:23:01 -0600
committerRory Dudley2024-09-02 22:35:15 -0600
commit97ca3fa5197599ec28b19d5b2048f7c24e4c8bbc (patch)
tree7aa7c52a74c0bbf8afd154ce0bf7de04f11f5f85 /src/poem/read.rs
parent5c29835f70178e64daeae9b82111fe31376f6f35 (diff)
downloaddwarvish-97ca3fa5197599ec28b19d5b2048f7c24e4c8bbc.tar.gz
Refactor Verse::clause()
There is no reason to return an option for clause(), since it makes us perform a match twice, and since a blank vector is perfectly acceptable in all cases where the verse at hand may not have a clause. Signed-off-by: Rory Dudley <rory@netc.lu>
Diffstat (limited to 'src/poem/read.rs')
-rw-r--r--src/poem/read.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/poem/read.rs b/src/poem/read.rs
index 7f3ae32..99e9aa6 100644
--- a/src/poem/read.rs
+++ b/src/poem/read.rs
@@ -149,10 +149,8 @@ impl Appendable for Poem {
lv.ep = verse.ep.clone();
lv.poems = verse.poems.clone();
lv.meter = verse.meter;
- if verse.clause().is_some() {
- for word in verse.clause().unwrap().iter() {
- lv.stanza.push(word.to_string());
- }
+ for word in verse.clause().iter() {
+ lv.stanza.push(word.to_string());
}
// Push verse(s)