diff options
| author | Fuwn <[email protected]> | 2022-07-24 11:58:08 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-07-24 11:58:08 +0000 |
| commit | 4094d93bb7e632d0211cdf2fc5e39f702ced300b (patch) | |
| tree | 281fc0b6ad90a03980d7fb491072e57a65803a98 | |
| parent | feat(germ): derive Clone for public structures (diff) | |
| download | germ-4094d93bb7e632d0211cdf2fc5e39f702ced300b.tar.xz germ-4094d93bb7e632d0211cdf2fc5e39f702ced300b.zip | |
fix(ast): potentially fix bad unwrapv0.3.7
| -rw-r--r-- | crates/germ/Cargo.toml | 2 | ||||
| -rw-r--r-- | crates/germ/src/ast/container.rs | 7 |
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() { |