From d6faad17e814d252a72e3aca39a4b3898382bab9 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Wed, 25 Sep 2024 14:37:17 +0100 Subject: chore: bump rust-nostr v0.35 bump all rust-nostr packages --- src/bin/ngit/sub_commands/list.rs | 14 +++++++------- src/bin/ngit/sub_commands/pull.rs | 9 +++------ src/bin/ngit/sub_commands/push.rs | 11 ++++------- src/bin/ngit/sub_commands/send.rs | 4 ++-- 4 files changed, 16 insertions(+), 22 deletions(-) (limited to 'src/bin/ngit') diff --git a/src/bin/ngit/sub_commands/list.rs b/src/bin/ngit/sub_commands/list.rs index 0755e3b..351896a 100644 --- a/src/bin/ngit/sub_commands/list.rs +++ b/src/bin/ngit/sub_commands/list.rs @@ -52,7 +52,7 @@ pub async fn launch() -> Result<()> { vec![ nostr::Filter::default() .kinds(status_kinds().clone()) - .events(proposals_and_revisions.iter().map(nostr::Event::id)), + .events(proposals_and_revisions.iter().map(|e| e.id)), ], ) .await?; @@ -76,15 +76,15 @@ pub async fn launch() -> Result<()> { let status = if let Some(e) = statuses .iter() .filter(|e| { - status_kinds().contains(&e.kind()) - && e.tags() + status_kinds().contains(&e.kind) + && e.tags .iter() - .any(|t| t.as_vec()[1].eq(&proposal.id.to_string())) + .any(|t| t.as_slice()[1].eq(&proposal.id.to_string())) }) .collect::>() .first() { - e.kind() + e.kind } else { Kind::GitStatusOpen }; @@ -184,7 +184,7 @@ pub async fn launch() -> Result<()> { let commits_events: Vec = get_all_proposal_patch_events_from_cache( git_repo_path, &repo_ref, - &proposals_for_status[selected_index].id(), + &proposals_for_status[selected_index].id, ) .await?; @@ -704,7 +704,7 @@ fn save_patches_to_dir(mut patches: Vec, git_repo: &Repo) -> Resul .truncate(true) .open(path) .context("open new patch file with write and truncate options")?; - file.write_all(patch.content().as_bytes())?; + file.write_all(patch.content.as_bytes())?; file.write_all("\n\n".as_bytes())?; file.flush()?; } diff --git a/src/bin/ngit/sub_commands/pull.rs b/src/bin/ngit/sub_commands/pull.rs index 9a3d911..d79b7b1 100644 --- a/src/bin/ngit/sub_commands/pull.rs +++ b/src/bin/ngit/sub_commands/pull.rs @@ -53,12 +53,9 @@ pub async fn launch() -> Result<()> { .context("cannot find proposal that matches the current branch name")? .clone(); - let commit_events = get_all_proposal_patch_events_from_cache( - git_repo_path, - &repo_ref, - &proposal_root_event.id(), - ) - .await?; + let commit_events = + get_all_proposal_patch_events_from_cache(git_repo_path, &repo_ref, &proposal_root_event.id) + .await?; let most_recent_proposal_patch_chain = get_most_recent_patch_with_ancestors(commit_events.clone()) diff --git a/src/bin/ngit/sub_commands/push.rs b/src/bin/ngit/sub_commands/push.rs index 66edfb4..a77f356 100644 --- a/src/bin/ngit/sub_commands/push.rs +++ b/src/bin/ngit/sub_commands/push.rs @@ -73,12 +73,9 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { .context("cannot find proposal that matches the current branch name")? .clone(); - let commit_events = get_all_proposal_patch_events_from_cache( - git_repo_path, - &repo_ref, - &proposal_root_event.id(), - ) - .await?; + let commit_events = + get_all_proposal_patch_events_from_cache(git_repo_path, &repo_ref, &proposal_root_event.id) + .await?; let most_recent_proposal_patch_chain = get_most_recent_patch_with_ancestors(commit_events) .context("cannot get most recent patch for proposal")?; @@ -191,7 +188,7 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { Some(proposal_root_event.id), &signer, &repo_ref, - patch_events.last().map(nostr::Event::id), + patch_events.last().map(|e| e.id), None, None, &None, diff --git a/src/bin/ngit/sub_commands/send.rs b/src/bin/ngit/sub_commands/send.rs index a807305..fe2952f 100644 --- a/src/bin/ngit/sub_commands/send.rs +++ b/src/bin/ngit/sub_commands/send.rs @@ -240,9 +240,9 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs, no_fetch: bool) -> Re if root_proposal_id.is_none() { if let Some(event) = events.first() { let event_bech32 = if let Some(relay) = repo_ref.relays.first() { - Nip19Event::new(event.id(), vec![relay]).to_bech32()? + Nip19Event::new(event.id, vec![relay]).to_bech32()? } else { - event.id().to_bech32()? + event.id.to_bech32()? }; println!( "{}", -- cgit v1.2.3