upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2024-02-20 10:10:19 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2024-02-20 10:10:19 +0000
commit0509d42a088539da441c7ce62f3fe7ac6c66fa68 (patch)
tree28420b77a928dfb22502e6e60ac21fec7d1a1f49 /src
parent33b01ba13149e8c893ec7a1877d9578c8c403a4f (diff)
fix: cover letter description from patch
if description isn't present this was causing an breaking error
Diffstat (limited to 'src')
-rw-r--r--src/sub_commands/send.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/sub_commands/send.rs b/src/sub_commands/send.rs
index 403f1fd..1633cb8 100644
--- a/src/sub_commands/send.rs
+++ b/src/sub_commands/send.rs
@@ -488,8 +488,7 @@ pub fn event_to_cover_letter(event: &nostr::Event) -> Result<CoverLetter> {
488 488
489 let description_index_end = event.content[title_index..] 489 let description_index_end = event.content[title_index..]
490 .find("\ndiff --git") 490 .find("\ndiff --git")
491 .unwrap_or(event.content.len() - 1) 491 .unwrap_or(event.content.len() - 1);
492 + title_index;
493 492
494 let title = if let Ok(msg) = tag_value(event, "description") { 493 let title = if let Ok(msg) = tag_value(event, "description") {
495 msg.split('\n').collect::<Vec<&str>>()[0].to_string() 494 msg.split('\n').collect::<Vec<&str>>()[0].to_string()