diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-02-20 10:10:19 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-02-20 10:10:19 +0000 |
| commit | 0509d42a088539da441c7ce62f3fe7ac6c66fa68 (patch) | |
| tree | 28420b77a928dfb22502e6e60ac21fec7d1a1f49 /src/sub_commands | |
| parent | 33b01ba13149e8c893ec7a1877d9578c8c403a4f (diff) | |
fix: cover letter description from patch
if description isn't present this was causing an breaking error
Diffstat (limited to 'src/sub_commands')
| -rw-r--r-- | src/sub_commands/send.rs | 3 |
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() |