Skip to content

Commit

Permalink
fix: avoid as_ref() call as bstr could break downstream with new …
Browse files Browse the repository at this point in the history
…impls (#1466)

As `bstr` adds a new implementation of `AsRef`, the `as_ref()` call becomes
ambiguous which will then break `gitoxide`.

Now `as_ref()` is avoided in favor of a method that can't fail.
  • Loading branch information
Byron committed Jul 25, 2024
1 parent 37c2852 commit 1772f88
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions gitoxide-core/src/repository/status.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::bail;
use gix::bstr::{BStr, BString};
use gix::bstr::{BStr, BString, ByteSlice};
use gix::status::index_worktree::iter::Item;
use gix_status::index_as_worktree::{Change, Conflict, EntryStatus};
use std::path::Path;
Expand Down Expand Up @@ -152,7 +152,7 @@ pub fn show(
source_rela_path =
gix::path::relativize_with_prefix(&gix::path::from_bstr(source.rela_path()), prefix).display(),
dest_rela_path = gix::path::relativize_with_prefix(
&gix::path::from_bstr(dirwalk_entry.rela_path.as_ref()),
&gix::path::from_bstr(dirwalk_entry.rela_path.as_bstr()),
prefix
)
.display(),
Expand Down
2 changes: 1 addition & 1 deletion gix-credentials/src/program/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl Program {
args.insert_str(0, "credential-");
args.insert_str(0, " ");
args.insert_str(0, git_program.to_string_lossy().as_ref());
gix_command::prepare(gix_path::from_bstr(args.as_ref()).into_owned())
gix_command::prepare(gix_path::from_bstr(args.as_bstr()).into_owned())
.arg(action.as_arg(true))
.with_shell_allow_argument_splitting()
.into()
Expand Down

0 comments on commit 1772f88

Please sign in to comment.