Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion asyncgit/src/asyncjob/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ impl<J: 'static + AsyncJob> AsyncSingleJob<J> {
let self_clone = (*self).clone();
rayon_core::spawn(move || {
if let Err(e) = self_clone.run_job(task) {
log::error!("async job error: {}", e);
log::error!("async job error: {e}");
}
});

Expand Down
2 changes: 1 addition & 1 deletion asyncgit/src/blame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ impl AsyncBlame {

let notify = match notify {
Err(err) => {
log::error!("get_blame_helper error: {}", err);
log::error!("get_blame_helper error: {err}");
true
}
Ok(notify) => notify,
Expand Down
2 changes: 1 addition & 1 deletion asyncgit/src/commit_files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl AsyncCommitFiles {
return Ok(());
}

log::trace!("request: {:?}", params);
log::trace!("request: {params:?}");

{
let current = self.current.lock()?;
Expand Down
6 changes: 3 additions & 3 deletions asyncgit/src/diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ impl AsyncDiff {
&self,
params: DiffParams,
) -> Result<Option<FileDiff>> {
log::trace!("request {:?}", params);
log::trace!("request {params:?}");

let hash = hash(&params);

Expand Down Expand Up @@ -131,8 +131,8 @@ impl AsyncDiff {
);

let notify = match notify {
Err(err) => {
log::error!("get_diff_helper error: {}", err);
Err(e) => {
log::error!("get_diff_helper error: {e}");
true
}
Ok(notify) => notify,
Expand Down
2 changes: 1 addition & 1 deletion asyncgit/src/pull.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ impl AsyncPull {
*last_res = match res {
Ok(bytes) => Some((bytes, String::new())),
Err(e) => {
log::error!("fetch error: {}", e);
log::error!("fetch error: {e}");
Some((0, e.to_string()))
}
};
Expand Down
2 changes: 1 addition & 1 deletion asyncgit/src/push.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ impl AsyncPush {
*last_res = match res {
Ok(()) => None,
Err(e) => {
log::error!("push error: {}", e);
log::error!("push error: {e}",);
Some(e.to_string())
}
};
Expand Down
2 changes: 1 addition & 1 deletion asyncgit/src/push_tags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ impl AsyncPushTags {
*last_res = match res {
Ok(()) => None,
Err(e) => {
log::error!("push error: {}", e);
log::error!("push error: {e}");
Some(e.to_string())
}
};
Expand Down
3 changes: 1 addition & 2 deletions asyncgit/src/remote_progress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ impl RemoteProgress {
}
Err(e) => {
log::error!(
"remote progress receiver error: {}",
e
"remote progress receiver error: {e}",
);
break;
}
Expand Down
6 changes: 2 additions & 4 deletions asyncgit/src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ impl AsyncStatus {
&arc_current,
&arc_last,
) {
log::error!("fetch_helper: {}", e);
log::error!("fetch_helper: {e}");
}

arc_pending.fetch_sub(1, Ordering::Relaxed);
Expand All @@ -158,9 +158,7 @@ impl AsyncStatus {
) -> Result<()> {
let res = Self::get_status(repo, status_type, config)?;
log::trace!(
"status fetched: {} (type: {:?})",
hash_request,
status_type,
"status fetched: {hash_request} (type: {status_type:?})",
);

{
Expand Down
17 changes: 5 additions & 12 deletions asyncgit/src/sync/remotes/callbacks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,7 @@ impl Callbacks {
reference: &str,
msg: Option<&str>,
) {
log::debug!(
"push_update_reference: '{}' {:?}",
reference,
msg
);
log::debug!("push_update_reference: '{reference}' {msg:?}",);

if let Ok(mut stats) = self.stats.lock() {
stats.push_rejected_msg = msg
Expand All @@ -125,7 +121,7 @@ impl Callbacks {
total: usize,
current: usize,
) {
log::debug!("packing: {:?} - {}/{}", stage, current, total);
log::debug!("packing: {stage:?} - {current}/{total}");
self.sender.clone().map(|sender| {
sender.send(ProgressNotification::Packing {
stage,
Expand All @@ -150,7 +146,7 @@ impl Callbacks {
}

fn update_tips(&self, name: &str, a: git2::Oid, b: git2::Oid) {
log::debug!("update tips: '{}' [{}] [{}]", name, a, b);
log::debug!("update tips: '{name}' [{a}] [{b}]");
self.sender.clone().map(|sender| {
sender.send(ProgressNotification::UpdateTips {
name: name.to_string(),
Expand All @@ -166,7 +162,7 @@ impl Callbacks {
total: usize,
bytes: usize,
) {
log::debug!("progress: {}/{} ({} B)", current, total, bytes,);
log::debug!("progress: {current}/{total} ({bytes} B)",);
self.sender.clone().map(|sender| {
sender.send(ProgressNotification::PushTransfer {
current,
Expand All @@ -187,10 +183,7 @@ impl Callbacks {
allowed_types: git2::CredentialType,
) -> std::result::Result<Cred, GitError> {
log::debug!(
"creds: '{}' {:?} ({:?})",
url,
username_from_url,
allowed_types
"creds: '{url}' {username_from_url:?} ({allowed_types:?})",
);

// This boolean is used to avoid multiple calls to credentials callback.
Expand Down
2 changes: 1 addition & 1 deletion asyncgit/src/sync/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl From<RepositoryState> for RepoState {
RepositoryState::Revert => Self::Revert,
RepositoryState::RebaseMerge => Self::Rebase,
_ => {
log::warn!("state not supported yet: {:?}", state);
log::warn!("state not supported yet: {state:?}");
Self::Other
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ impl App {

///
pub fn event(&mut self, ev: InputEvent) -> Result<()> {
log::trace!("event: {:?}", ev);
log::trace!("event: {ev:?}");

if let InputEvent::Input(ev) = ev {
if self.check_hard_exit(&ev) || self.check_quit(&ev) {
Expand Down Expand Up @@ -402,7 +402,7 @@ impl App {
&mut self,
ev: AsyncNotification,
) -> Result<()> {
log::trace!("update_async: {:?}", ev);
log::trace!("update_async: {ev:?}");

if let AsyncNotification::Git(ev) = ev {
self.status_tab.update_git(ev)?;
Expand Down Expand Up @@ -1061,7 +1061,7 @@ impl App {
));
}
Err(e) => {
log::error!("delete remote: {}", e,);
log::error!("delete remote: {e:?}");
self.queue.push(InternalEvent::ShowErrorMsg(
format!("delete remote error:\n{e}",),
));
Expand Down
8 changes: 4 additions & 4 deletions src/clipboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ fn exec_copy_with_args(
Stdio::null()
})
.spawn()
.map_err(|e| anyhow!("`{:?}`: {}", command, e))?;
.map_err(|e| anyhow!("`{command:?}`: {e:?}"))?;

process
.stdin
.as_mut()
.ok_or_else(|| anyhow!("`{:?}`", command))?
.ok_or_else(|| anyhow!("`{command:?}`"))?
.write_all(text.as_bytes())
.map_err(|e| anyhow!("`{:?}`: {}", command, e))?;
.map_err(|e| anyhow!("`{command:?}`: {e:?}"))?;

let out = process
.wait_with_output()
.map_err(|e| anyhow!("`{:?}`: {}", command, e))?;
.map_err(|e| anyhow!("`{command:?}`: {e:?}"))?;

if out.status.success() {
Ok(())
Expand Down
1 change: 0 additions & 1 deletion src/components/status_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,6 @@ impl Component for StatusTreeComponent {
CommandBlocking::PassingOn
}

#[expect(clippy::cognitive_complexity)]
fn event(&mut self, ev: &Event) -> Result<EventState> {
if self.focused {
if let Event::Key(e) = ev {
Expand Down
2 changes: 1 addition & 1 deletion src/components/utils/filetree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ impl FileTreeItem {
),
kind: FileTreeItemKind::File(item.clone()),
}),
None => bail!("invalid file name {:?}", item),
None => bail!("invalid file name {item:?}"),
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl Input {
if let Err(e) =
Self::input_loop(&arc_desired, &arc_current, &tx)
{
log::error!("input thread error: {}", e);
log::error!("input thread error: {e}");
arc_aborted.store(true, Ordering::SeqCst);
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ fn draw(terminal: &mut Terminal, app: &App) -> io::Result<()> {

terminal.draw(|f| {
if let Err(e) = app.draw(f) {
log::error!("failed to draw: {:?}", e);
log::error!("failed to draw: {e:?}");
}
})?;

Expand Down
2 changes: 1 addition & 1 deletion src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ impl Options {

fn save(&self) {
if let Err(e) = self.save_failable() {
log::error!("options save error: {}", e);
log::error!("options save error: {e}");
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/popups/commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ impl CommitPopup {
if let HookResult::NotOk(e) =
sync::hooks_pre_commit(&self.repo.borrow())?
{
log::error!("pre-commit hook error: {}", e);
log::error!("pre-commit hook error: {e}");
self.queue.push(InternalEvent::ShowErrorMsg(
format!("pre-commit hook error:\n{e}"),
));
Expand All @@ -256,7 +256,7 @@ impl CommitPopup {
if let HookResult::NotOk(e) =
sync::hooks_commit_msg(&self.repo.borrow(), &mut msg)?
{
log::error!("commit-msg hook error: {}", e);
log::error!("commit-msg hook error: {e}");
self.queue.push(InternalEvent::ShowErrorMsg(
format!("commit-msg hook error:\n{e}"),
));
Expand All @@ -268,7 +268,7 @@ impl CommitPopup {
if let HookResult::NotOk(e) =
sync::hooks_post_commit(&self.repo.borrow())?
{
log::error!("post-commit hook error: {}", e);
log::error!("post-commit hook error: {e}");
self.queue.push(InternalEvent::ShowErrorMsg(format!(
"post-commit hook error:\n{e}"
)));
Expand Down Expand Up @@ -400,7 +400,7 @@ impl CommitPopup {
"commit.template",
)
.map_err(|e| {
log::error!("load git-config failed: {}", e);
log::error!("load git-config failed: {e}");
e
})
.ok()
Expand All @@ -415,7 +415,7 @@ impl CommitPopup {
.and_then(|path| {
read_to_string(&path)
.map_err(|e| {
log::error!("read commit.template failed: {e} (path: '{:?}')",path);
log::error!("read commit.template failed: {e} (path: '{path:?}')");
e
})
.ok()
Expand Down
2 changes: 1 addition & 1 deletion src/popups/create_branch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl CreateBranchPopup {
));
}
Err(e) => {
log::error!("create branch: {}", e,);
log::error!("create branch: {e}");
self.queue.push(InternalEvent::ShowErrorMsg(
format!("create branch error:\n{e}",),
));
Expand Down
2 changes: 1 addition & 1 deletion src/popups/create_remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ impl CreateRemotePopup {
));
}
Err(e) => {
log::error!("create remote: {}", e,);
log::error!("create remote: {e}");
self.queue.push(InternalEvent::ShowErrorMsg(
format!("create remote error:\n{e}",),
));
Expand Down
4 changes: 2 additions & 2 deletions src/popups/externaleditor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl ExternalEditorPopup {
};

if !path.exists() {
bail!("file not found: {:?}", path);
bail!("file not found: {path:?}");
}

io::stdout().execute(LeaveAlternateScreen)?;
Expand Down Expand Up @@ -113,7 +113,7 @@ impl ExternalEditorPopup {
.current_dir(work_dir)
.args(args)
.status()
.map_err(|e| anyhow!("\"{}\": {}", command, e))?;
.map_err(|e| anyhow!("\"{command}\": {e}"))?;

Ok(())
}
Expand Down
4 changes: 2 additions & 2 deletions src/popups/pull.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ impl PullPopup {
&self.repo.borrow(),
&self.branch,
);
if let Err(err) = ff_res {
log::trace!("ff failed: {}", err);
if let Err(e) = ff_res {
log::trace!("ff failed: {e}");
self.confirm_merge(branch_compare.behind);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/popups/rename_branch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ impl RenameBranchPopup {
self.queue.push(InternalEvent::SelectBranch);
}
Err(e) => {
log::error!("create branch: {}", e,);
log::error!("create branch: {e}");
self.queue.push(InternalEvent::ShowErrorMsg(
format!("rename branch error:\n{e}",),
));
Expand Down
2 changes: 1 addition & 1 deletion src/popups/rename_remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ impl RenameRemotePopup {
));
}
Err(e) => {
log::error!("rename remote: {}", e,);
log::error!("rename remote: {e}");
self.queue.push(InternalEvent::ShowErrorMsg(
format!("rename remote error:\n{e}",),
));
Expand Down
2 changes: 1 addition & 1 deletion src/popups/tag_commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ impl TagCommitPopup {
self.input.set_text(tag_name);
self.hide();

log::error!("e: {}", e,);
log::error!("e: {e}");
self.queue.push(InternalEvent::ShowErrorMsg(
format!("tag error:\n{e}",),
));
Expand Down
2 changes: 1 addition & 1 deletion src/popups/update_remote_url.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ impl UpdateRemoteUrlPopup {
));
}
Err(e) => {
log::error!("update remote url: {}", e,);
log::error!("update remote url: {e}");
self.queue.push(InternalEvent::ShowErrorMsg(
format!("update remote url error:\n{e}",),
));
Expand Down
2 changes: 1 addition & 1 deletion src/tabs/revlog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ impl Revlog {
self.search,
LogSearch::Off | LogSearch::Results(_)
) {
log::info!("start search: {:?}", options);
log::info!("start search: {options:?}");

let filter = filter_commit_by_search(
LogFilterSearch::new(options.clone()),
Expand Down
Loading
Loading