From 4ee83e2fe5335a8afd78439c35f029c4a472e797 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Mon, 16 Dec 2024 09:00:46 +0000 Subject: chore: bump nix flake rust nightly `fmt` overlay update the rust nightly `fmt` overlay which needs to be pinned to a specific version (this case by date) update formatting in main files via `cargo fmt` --- src/bin/ngit/cli.rs | 2 +- src/bin/ngit/sub_commands/export_keys.rs | 2 +- src/bin/ngit/sub_commands/init.rs | 12 ++++++------ src/bin/ngit/sub_commands/list.rs | 19 ++++++++----------- src/bin/ngit/sub_commands/login.rs | 4 ++-- src/bin/ngit/sub_commands/logout.rs | 2 +- src/bin/ngit/sub_commands/send.rs | 17 ++++++++--------- 7 files changed, 27 insertions(+), 31 deletions(-) (limited to 'src/bin/ngit') diff --git a/src/bin/ngit/cli.rs b/src/bin/ngit/cli.rs index 1737a9f..60bc5d2 100644 --- a/src/bin/ngit/cli.rs +++ b/src/bin/ngit/cli.rs @@ -1,4 +1,4 @@ -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::{Parser, Subcommand}; use ngit::login::SignerInfo; diff --git a/src/bin/ngit/sub_commands/export_keys.rs b/src/bin/ngit/sub_commands/export_keys.rs index 54a716f..45b1b89 100644 --- a/src/bin/ngit/sub_commands/export_keys.rs +++ b/src/bin/ngit/sub_commands/export_keys.rs @@ -2,9 +2,9 @@ use anyhow::{Context, Result}; use ngit::{ cli_interactor::{Interactor, InteractorPrompt, PromptChoiceParms}, login::{ + SignerInfo, SignerInfoSource, existing::{get_signer_info, load_existing_login}, fresh::generate_qr, - SignerInfo, SignerInfoSource, }, }; diff --git a/src/bin/ngit/sub_commands/init.rs b/src/bin/ngit/sub_commands/init.rs index 0894f41..80e182b 100644 --- a/src/bin/ngit/sub_commands/init.rs +++ b/src/bin/ngit/sub_commands/init.rs @@ -3,18 +3,18 @@ use std::collections::HashMap; use anyhow::{Context, Result}; use console::Style; use ngit::{cli_interactor::PromptConfirmParms, git::nostr_url::NostrUrlDecoded}; -use nostr::{nips::nip01::Coordinate, FromBech32, PublicKey, ToBech32}; +use nostr::{FromBech32, PublicKey, ToBech32, nips::nip01::Coordinate}; use nostr_sdk::{Kind, RelayUrl}; use crate::{ - cli::{extract_signer_cli_arguments, Cli}, + cli::{Cli, extract_signer_cli_arguments}, cli_interactor::{Interactor, InteractorPrompt, PromptInputParms}, - client::{fetching_with_report, get_repo_ref_from_cache, send_events, Client, Connect}, - git::{nostr_url::convert_clone_url_to_https, Repo, RepoActions}, + client::{Client, Connect, fetching_with_report, get_repo_ref_from_cache, send_events}, + git::{Repo, RepoActions, nostr_url::convert_clone_url_to_https}, login, repo_ref::{ - extract_pks, get_repo_config_from_yaml, save_repo_config_to_yaml, - try_and_get_repo_coordinates_when_remote_unknown, RepoRef, + RepoRef, extract_pks, get_repo_config_from_yaml, save_repo_config_to_yaml, + try_and_get_repo_coordinates_when_remote_unknown, }, }; diff --git a/src/bin/ngit/sub_commands/list.rs b/src/bin/ngit/sub_commands/list.rs index ee015ef..9b84c1b 100644 --- a/src/bin/ngit/sub_commands/list.rs +++ b/src/bin/ngit/sub_commands/list.rs @@ -1,6 +1,6 @@ use std::{io::Write, ops::Add}; -use anyhow::{bail, Context, Result}; +use anyhow::{Context, Result, bail}; use ngit::{ client::{get_all_proposal_patch_events_from_cache, get_proposals_and_revisions_from_cache}, git_events::{ @@ -12,9 +12,9 @@ use nostr_sdk::Kind; use crate::{ cli_interactor::{Interactor, InteractorPrompt, PromptChoiceParms, PromptConfirmParms}, client::{ - fetching_with_report, get_events_from_local_cache, get_repo_ref_from_cache, Client, Connect, + Client, Connect, fetching_with_report, get_events_from_local_cache, get_repo_ref_from_cache, }, - git::{str_to_sha1, Repo, RepoActions}, + git::{Repo, RepoActions, str_to_sha1}, git_events::{ commit_msg_from_patch_oneliner, event_is_revision_root, event_to_cover_letter, patch_supports_commit_ids, @@ -47,14 +47,11 @@ pub async fn launch() -> Result<()> { } let statuses: Vec = { - let mut statuses = get_events_from_local_cache( - git_repo_path, - vec![ - nostr::Filter::default() - .kinds(status_kinds().clone()) - .events(proposals_and_revisions.iter().map(|e| e.id)), - ], - ) + let mut statuses = get_events_from_local_cache(git_repo_path, vec![ + nostr::Filter::default() + .kinds(status_kinds().clone()) + .events(proposals_and_revisions.iter().map(|e| e.id)), + ]) .await?; statuses.sort_by_key(|e| e.created_at); statuses.reverse(); diff --git a/src/bin/ngit/sub_commands/login.rs b/src/bin/ngit/sub_commands/login.rs index ccbdf01..06236ec 100644 --- a/src/bin/ngit/sub_commands/login.rs +++ b/src/bin/ngit/sub_commands/login.rs @@ -3,11 +3,11 @@ use clap; use ngit::{ cli_interactor::{Interactor, InteractorPrompt, PromptChoiceParms}, git::{get_git_config_item, remove_git_config_item}, - login::{existing::load_existing_login, SignerInfoSource}, + login::{SignerInfoSource, existing::load_existing_login}, }; use crate::{ - cli::{extract_signer_cli_arguments, Cli}, + cli::{Cli, extract_signer_cli_arguments}, client::{Client, Connect}, git::Repo, login::fresh::fresh_login_or_signup, diff --git a/src/bin/ngit/sub_commands/logout.rs b/src/bin/ngit/sub_commands/logout.rs index f3f9620..2df96c8 100644 --- a/src/bin/ngit/sub_commands/logout.rs +++ b/src/bin/ngit/sub_commands/logout.rs @@ -1,7 +1,7 @@ use anyhow::{Context, Result}; use ngit::{ git::remove_git_config_item, - login::{existing::load_existing_login, SignerInfoSource}, + login::{SignerInfoSource, existing::load_existing_login}, }; use crate::{ diff --git a/src/bin/ngit/sub_commands/send.rs b/src/bin/ngit/sub_commands/send.rs index c6c75c9..7c898bc 100644 --- a/src/bin/ngit/sub_commands/send.rs +++ b/src/bin/ngit/sub_commands/send.rs @@ -1,23 +1,23 @@ use std::path::Path; -use anyhow::{bail, Context, Result}; +use anyhow::{Context, Result, bail}; use console::Style; use ngit::{client::send_events, git_events::generate_cover_letter_and_patch_events}; use nostr::{ - nips::{nip10::Marker, nip19::Nip19Event}, ToBech32, + nips::{nip10::Marker, nip19::Nip19Event}, }; use nostr_sdk::hashes::sha1::Hash as Sha1Hash; use crate::{ - cli::{extract_signer_cli_arguments, Cli}, + cli::{Cli, extract_signer_cli_arguments}, cli_interactor::{ Interactor, InteractorPrompt, PromptConfirmParms, PromptInputParms, PromptMultiChoiceParms, }, client::{ - fetching_with_report, get_events_from_local_cache, get_repo_ref_from_cache, Client, Connect, + Client, Connect, fetching_with_report, get_events_from_local_cache, get_repo_ref_from_cache, }, - git::{identify_ahead_behind, Repo, RepoActions}, + git::{Repo, RepoActions, identify_ahead_behind}, git_events::{event_is_patch_set_root, event_tag_from_nip19_or_hex}, login, repo_ref::get_repo_coordinates_when_remote_unknown, @@ -369,10 +369,9 @@ async fn get_root_proposal_id_and_mentions_from_in_reply_to( public_key: _, uppercase: false, }) => { - let events = get_events_from_local_cache( - git_repo_path, - vec![nostr::Filter::new().id(*event_id)], - ) + let events = get_events_from_local_cache(git_repo_path, vec![ + nostr::Filter::new().id(*event_id), + ]) .await?; if let Some(first) = events.iter().find(|e| e.id.eq(event_id)) { -- cgit v1.2.3