aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2022-07-24 11:58:08 +0000
committerFuwn <[email protected]>2022-07-24 11:58:08 +0000
commit4094d93bb7e632d0211cdf2fc5e39f702ced300b (patch)
tree281fc0b6ad90a03980d7fb491072e57a65803a98
parentfeat(germ): derive Clone for public structures (diff)
downloadgerm-4094d93bb7e632d0211cdf2fc5e39f702ced300b.tar.xz
germ-4094d93bb7e632d0211cdf2fc5e39f702ced300b.zip
fix(ast): potentially fix bad unwrapv0.3.7
-rw-r--r--crates/germ/Cargo.toml2
-rw-r--r--crates/germ/src/ast/container.rs7
2 files changed, 7 insertions, 2 deletions
diff --git a/crates/germ/Cargo.toml b/crates/germ/Cargo.toml
index a00114c..ec81427 100644
--- a/crates/germ/Cargo.toml
+++ b/crates/germ/Cargo.toml
@@ -2,7 +2,7 @@
[package]
name = "germ"
-version = "0.3.6"
+version = "0.3.7"
authors = ["Fuwn <[email protected]>"]
edition = "2021"
description = "The Ultimate Gemini Toolkit."
diff --git a/crates/germ/src/ast/container.rs b/crates/germ/src/ast/container.rs
index e97a092..793473b 100644
--- a/crates/germ/src/ast/container.rs
+++ b/crates/germ/src/ast/container.rs
@@ -232,7 +232,12 @@ impl Ast {
if *in_preformatted {
alt_text = line.get(3..).unwrap_or("").to_string();
- line = lines.next().unwrap();
+
+ if let Some(next_line) = lines.next() {
+ line = next_line;
+ } else {
+ break;
+ }
} else {
nodes.push(Node::PreformattedText {
alt_text: if alt_text.is_empty() {