mirror of
https://github.com/Byron/gitoxide
synced 2025-10-05 16:42:40 +02:00
chore: bump rust-version
to 1.70
That way clippy will allow to use the fantastic `Option::is_some_and()` and friends.
This commit is contained in:
@@ -9,7 +9,7 @@ repository = "https://github.com/GitoxideLabs/gitoxide"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2021"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
|
||||
description = "archive generation from of a worktree stream"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
|
||||
[lib]
|
||||
|
@@ -9,7 +9,7 @@ description = "A crate of the gitoxide project dealing .gitattributes files"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
|
||||
description = "A crate of the gitoxide project dedicated implementing the standard git bitmap format"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
exclude = ["CHANGELOG.md"]
|
||||
|
||||
[lib]
|
||||
|
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
|
||||
description = "A crate of the gitoxide project dedicated to implementing a 'blame' algorithm"
|
||||
authors = ["Christoph Rüßler <christoph.ruessler@mailbox.org>", "Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
@@ -10,7 +10,7 @@ documentation = "https://github.com/git/git/blob/seen/Documentation/technical/ch
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2021"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
|
||||
description = "A crate of the gitoxide project handling internal git command execution"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
include = ["src/lib.rs", "LICENSE-*"]
|
||||
|
||||
[lib]
|
||||
|
@@ -10,7 +10,7 @@ description = "Read-only access to the git commitgraph file format"
|
||||
authors = ["Conor Davis <gitoxide@conor.fastmail.fm>", "Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
|
||||
description = "A crate of the gitoxide project providing git-config value parsing"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
|
||||
[lib]
|
||||
|
@@ -11,7 +11,7 @@ edition = "2021"
|
||||
keywords = ["git-config", "git", "config", "gitoxide"]
|
||||
categories = ["config", "parser-implementations"]
|
||||
include = ["src/**/*", "LICENSE-*", "README.md"]
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
autotests = false
|
||||
|
||||
[features]
|
||||
|
@@ -9,10 +9,10 @@ pub(crate) mod section;
|
||||
pub(crate) mod value;
|
||||
|
||||
fn escape_value(value: &BStr) -> BString {
|
||||
let starts_with_whitespace = value.first().map_or(false, u8::is_ascii_whitespace);
|
||||
let starts_with_whitespace = value.first().is_some_and(u8::is_ascii_whitespace);
|
||||
let ends_with_whitespace = value
|
||||
.get(value.len().saturating_sub(1))
|
||||
.map_or(false, u8::is_ascii_whitespace);
|
||||
.is_some_and(u8::is_ascii_whitespace);
|
||||
let contains_comment_indicators = value.find_byteset(b";#").is_some();
|
||||
let quote = starts_with_whitespace || ends_with_whitespace || contains_comment_indicators;
|
||||
|
||||
|
@@ -274,11 +274,7 @@ impl<'a, 'event> SectionMut<'a, 'event> {
|
||||
/// Performs the removal, assuming the range is valid.
|
||||
fn remove_internal(&mut self, range: Range<usize>, fix_whitespace: bool) -> Cow<'event, BStr> {
|
||||
let events = &mut self.section.body.0;
|
||||
if fix_whitespace
|
||||
&& events
|
||||
.get(range.end)
|
||||
.map_or(false, |ev| matches!(ev, Event::Newline(_)))
|
||||
{
|
||||
if fix_whitespace && events.get(range.end).is_some_and(|ev| matches!(ev, Event::Newline(_))) {
|
||||
events.remove(range.end);
|
||||
}
|
||||
let value = events
|
||||
@@ -294,7 +290,7 @@ impl<'a, 'event> SectionMut<'a, 'event> {
|
||||
.start
|
||||
.checked_sub(1)
|
||||
.and_then(|pos| events.get(pos))
|
||||
.map_or(false, |ev| matches!(ev, Event::Whitespace(_)))
|
||||
.is_some_and(|ev| matches!(ev, Event::Whitespace(_)))
|
||||
{
|
||||
events.remove(range.start - 1);
|
||||
}
|
||||
|
@@ -62,7 +62,7 @@ fn validated_name(name: Cow<'_, BStr>) -> Result<Cow<'_, BStr>, Error> {
|
||||
impl Header<'_> {
|
||||
///Return true if this is a header like `[legacy.subsection]`, or false otherwise.
|
||||
pub fn is_legacy(&self) -> bool {
|
||||
self.separator.as_deref().map_or(false, |n| n == ".")
|
||||
self.separator.as_deref().is_some_and(|n| n == ".")
|
||||
}
|
||||
|
||||
/// Return the subsection name, if present, i.e. "origin" in `[remote "origin"]`.
|
||||
|
@@ -71,7 +71,7 @@ impl Source {
|
||||
.transpose()
|
||||
.ok()
|
||||
.flatten()
|
||||
.map_or(false, |b| b.0)
|
||||
.is_some_and(|b| b.0)
|
||||
{
|
||||
None
|
||||
} else {
|
||||
@@ -84,7 +84,7 @@ impl Source {
|
||||
.transpose()
|
||||
.ok()
|
||||
.flatten()
|
||||
.map_or(false, |b| b.0)
|
||||
.is_some_and(|b| b.0)
|
||||
{
|
||||
None
|
||||
} else {
|
||||
|
@@ -8,7 +8,7 @@ description = "Tests for the gix-config crate"
|
||||
license = "MIT OR Apache-2.0"
|
||||
authors = ["Edward Shen <code@eddie.sh>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
publish = false
|
||||
|
||||
|
||||
|
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
|
||||
description = "A crate of the gitoxide project to interact with git credentials helpers"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
|
||||
[lib]
|
||||
|
@@ -9,7 +9,7 @@ description = "Calculate differences between various git objects"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
autotests = false
|
||||
|
||||
[features]
|
||||
|
@@ -406,7 +406,7 @@ impl Pipeline {
|
||||
if matches!(mode, EntryKind::Blob | EntryKind::BlobExecutable)
|
||||
&& convert == Mode::ToWorktreeAndBinaryToText
|
||||
|| (convert == Mode::ToGitUnlessBinaryToTextIsPresent
|
||||
&& driver.map_or(false, |d| d.binary_to_text_command.is_some()))
|
||||
&& driver.is_some_and(|d| d.binary_to_text_command.is_some()))
|
||||
{
|
||||
let res =
|
||||
self.worktree_filter
|
||||
|
@@ -59,7 +59,7 @@ where
|
||||
let pattern_matches = RefCell::new(|relative_path, entry: &gix_index::Entry| {
|
||||
pathspec
|
||||
.pattern_matching_relative_path(relative_path, Some(entry.mode.is_submodule()), pathspec_attributes)
|
||||
.map_or(false, |m| !m.is_excluded())
|
||||
.is_some_and(|m| !m.is_excluded())
|
||||
});
|
||||
|
||||
let (mut lhs_iter, mut rhs_iter) = (
|
||||
|
@@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0"
|
||||
description = "Tests for the gix-diff crate"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[[test]]
|
||||
doctest = false
|
||||
|
@@ -1004,7 +1004,7 @@ fn realistic_renames_disabled_2() -> crate::Result {
|
||||
// Directories are associated with their children, making a bundling possible.
|
||||
insta::assert_debug_snapshot!(changes.into_iter()
|
||||
.filter(|c| !c.entry_mode().is_tree() ||
|
||||
c.relation().map_or(false, |r| matches!(r, Relation::Parent(_)))
|
||||
c.relation().is_some_and(|r| matches!(r, Relation::Parent(_)))
|
||||
).collect::<Vec<_>>(), @r#"
|
||||
[
|
||||
Deletion {
|
||||
@@ -1427,7 +1427,7 @@ fn realistic_renames_2() -> crate::Result {
|
||||
// Look how nicely it captures and associates this directory rename.
|
||||
insta::assert_debug_snapshot!(changes.into_iter()
|
||||
.filter(|c| !c.entry_mode().is_tree() ||
|
||||
c.relation().map_or(false, |r| matches!(r, Relation::Parent(_)))
|
||||
c.relation().is_some_and(|r| matches!(r, Relation::Parent(_)))
|
||||
).collect::<Vec<_>>(), @r#"
|
||||
[
|
||||
Rewrite {
|
||||
@@ -1690,7 +1690,7 @@ fn realistic_renames_3_without_identity() -> crate::Result {
|
||||
// Look how nicely it captures and associates this directory rename.
|
||||
insta::assert_debug_snapshot!(changes.into_iter()
|
||||
.filter(|c| !c.entry_mode().is_tree() ||
|
||||
c.relation().map_or(false, |r| matches!(r, Relation::Parent(_)))
|
||||
c.relation().is_some_and(|r| matches!(r, Relation::Parent(_)))
|
||||
).collect::<Vec<_>>(), @r#"
|
||||
[
|
||||
Rewrite {
|
||||
|
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
|
||||
description = "A crate of the gitoxide project dealing with directory walks"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
@@ -190,7 +190,7 @@ impl Status {
|
||||
for_deletion: Option<ForDeletionMode>,
|
||||
worktree_root_is_repository: bool,
|
||||
) -> bool {
|
||||
let is_dir_on_disk = file_type.map_or(false, |ft| {
|
||||
let is_dir_on_disk = file_type.is_some_and(|ft| {
|
||||
if worktree_root_is_repository {
|
||||
ft.is_dir()
|
||||
} else {
|
||||
@@ -203,13 +203,13 @@ impl Status {
|
||||
match self {
|
||||
Status::Pruned => false,
|
||||
Status::Ignored(_) => {
|
||||
for_deletion.map_or(false, |fd| {
|
||||
for_deletion.is_some_and(|fd| {
|
||||
matches!(
|
||||
fd,
|
||||
ForDeletionMode::FindNonBareRepositoriesInIgnoredDirectories
|
||||
| ForDeletionMode::FindRepositoriesInIgnoredDirectories
|
||||
)
|
||||
}) || pathspec_match.map_or(false, |m| !m.should_ignore())
|
||||
}) || pathspec_match.is_some_and(|m| !m.should_ignore())
|
||||
}
|
||||
Status::Untracked | Status::Tracked => true,
|
||||
}
|
||||
|
@@ -24,7 +24,7 @@ pub fn root(
|
||||
let mut out = path(&mut path_buf, buf, 0, file_kind, || None, options, ctx)?;
|
||||
let worktree_root_is_repository = out
|
||||
.disk_kind
|
||||
.map_or(false, |kind| matches!(kind, entry::Kind::Repository));
|
||||
.is_some_and(|kind| matches!(kind, entry::Kind::Repository));
|
||||
|
||||
for component in worktree_relative_root.components() {
|
||||
if last_length.is_some() {
|
||||
@@ -200,7 +200,7 @@ pub fn path(
|
||||
.pattern_matching_relative_path(rela_path.as_bstr(), kind.map(|ft| ft.is_dir()), ctx.pathspec_attributes)
|
||||
.map(Into::into);
|
||||
|
||||
if worktree_relative_worktree_dirs.map_or(false, |worktrees| worktrees.contains(&*rela_path)) {
|
||||
if worktree_relative_worktree_dirs.is_some_and(|worktrees| worktrees.contains(&*rela_path)) {
|
||||
return Ok(out
|
||||
.with_kind(Some(entry::Kind::Repository), None)
|
||||
.with_status(entry::Status::Tracked));
|
||||
@@ -267,9 +267,9 @@ pub fn path(
|
||||
),
|
||||
);
|
||||
}
|
||||
if kind.map_or(false, |d| d.is_recursable_dir())
|
||||
if kind.is_some_and(|d| d.is_recursable_dir())
|
||||
&& (out.pathspec_match.is_none()
|
||||
|| worktree_relative_worktree_dirs.map_or(false, |worktrees| {
|
||||
|| worktree_relative_worktree_dirs.is_some_and(|worktrees| {
|
||||
for_deletion.is_some()
|
||||
&& worktrees
|
||||
.iter()
|
||||
@@ -289,7 +289,7 @@ pub fn path(
|
||||
debug_assert!(maybe_status.is_none());
|
||||
let mut status = entry::Status::Untracked;
|
||||
|
||||
if kind.map_or(false, |ft| ft.is_dir()) {
|
||||
if kind.is_some_and(|ft| ft.is_dir()) {
|
||||
kind = maybe_upgrade_to_repository(kind, classify_untracked_bare_repositories);
|
||||
} else if out.pathspec_match.is_none() {
|
||||
status = entry::Status::Pruned;
|
||||
@@ -313,7 +313,7 @@ pub fn maybe_upgrade_to_repository(
|
||||
if is_nested_repo {
|
||||
let git_dir_is_our_own = gix_path::realpath_opts(path, current_dir, gix_path::realpath::MAX_SYMLINKS)
|
||||
.ok()
|
||||
.map_or(false, |realpath_candidate| realpath_candidate == git_dir_realpath);
|
||||
.is_some_and(|realpath_candidate| realpath_candidate == git_dir_realpath);
|
||||
is_nested_repo = !git_dir_is_our_own;
|
||||
}
|
||||
if is_nested_repo {
|
||||
@@ -325,7 +325,7 @@ pub fn maybe_upgrade_to_repository(
|
||||
if is_nested_nonbare_repo {
|
||||
let git_dir_is_our_own = gix_path::realpath_opts(path, current_dir, gix_path::realpath::MAX_SYMLINKS)
|
||||
.ok()
|
||||
.map_or(false, |realpath_candidate| realpath_candidate == git_dir_realpath);
|
||||
.is_some_and(|realpath_candidate| realpath_candidate == git_dir_realpath);
|
||||
is_nested_nonbare_repo = !git_dir_is_our_own;
|
||||
}
|
||||
path.pop();
|
||||
@@ -387,7 +387,7 @@ fn resolve_file_type_with_index(
|
||||
}
|
||||
Some(entry) => {
|
||||
let icase_dir = index.entry_closest_to_directory_icase(rela_path.as_bstr(), true, accelerate);
|
||||
let directory_matches_exactly = icase_dir.map_or(false, |dir| {
|
||||
let directory_matches_exactly = icase_dir.is_some_and(|dir| {
|
||||
let path = dir.path(index);
|
||||
let slash_idx = path.rfind_byte(b'/').expect("dir");
|
||||
path[..slash_idx].as_bstr() == rela_path
|
||||
@@ -430,7 +430,7 @@ fn resolve_file_type_with_index(
|
||||
if all_excluded_from_worktree_non_cone
|
||||
|| one_index_signalling_with_cone
|
||||
.filter(|_| kind.is_none())
|
||||
.map_or(false, |idx| index.entries()[idx].mode.is_sparse())
|
||||
.is_some_and(|idx| index.entries()[idx].mode.is_sparse())
|
||||
{
|
||||
special_property = Some(entry::Property::TrackedExcluded);
|
||||
}
|
||||
|
@@ -83,7 +83,7 @@ pub fn walk(
|
||||
delegate,
|
||||
);
|
||||
if !can_recurse {
|
||||
if buf.is_empty() && !root_info.disk_kind.map_or(false, |kind| kind.is_dir()) {
|
||||
if buf.is_empty() && !root_info.disk_kind.is_some_and(|kind| kind.is_dir()) {
|
||||
return Err(Error::WorktreeRootIsFile { root: root.to_owned() });
|
||||
}
|
||||
if options.precompose_unicode {
|
||||
@@ -159,7 +159,7 @@ pub(super) fn can_recurse(
|
||||
worktree_root_is_repository: bool,
|
||||
delegate: &mut dyn Delegate,
|
||||
) -> bool {
|
||||
let is_dir = info.disk_kind.map_or(false, |k| k.is_dir());
|
||||
let is_dir = info.disk_kind.is_some_and(|k| k.is_dir());
|
||||
if !is_dir {
|
||||
return false;
|
||||
}
|
||||
|
@@ -26,7 +26,7 @@ pub(super) fn recursive(
|
||||
out: &mut Outcome,
|
||||
state: &mut State,
|
||||
) -> Result<(Action, bool), Error> {
|
||||
if ctx.should_interrupt.map_or(false, |flag| flag.load(Ordering::Relaxed)) {
|
||||
if ctx.should_interrupt.is_some_and(|flag| flag.load(Ordering::Relaxed)) {
|
||||
return Err(Error::Interrupted);
|
||||
}
|
||||
out.read_dir_calls += 1;
|
||||
@@ -303,12 +303,10 @@ impl Mark {
|
||||
if kind == Some(entry::Kind::Repository) {
|
||||
return None;
|
||||
}
|
||||
if pathspec_match.map_or(false, |m| {
|
||||
matches!(m, PathspecMatch::Verbatim | PathspecMatch::Excluded)
|
||||
}) {
|
||||
if pathspec_match.is_some_and(|m| matches!(m, PathspecMatch::Verbatim | PathspecMatch::Excluded)) {
|
||||
return None;
|
||||
}
|
||||
matching_entries += usize::from(pathspec_match.map_or(false, |m| !m.should_ignore()));
|
||||
matching_entries += usize::from(pathspec_match.is_some_and(|m| !m.should_ignore()));
|
||||
match status {
|
||||
Status::Pruned => {
|
||||
unreachable!("BUG: pruned aren't ever held, check `should_hold()`")
|
||||
|
@@ -9,7 +9,7 @@ description = "Discover git repositories and check if a directory is a git repos
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
@@ -89,7 +89,7 @@ pub(crate) mod function {
|
||||
let mut current_height = 0;
|
||||
let mut cursor_metadata = Some(dir_metadata);
|
||||
'outer: loop {
|
||||
if max_height.map_or(false, |x| current_height > x) {
|
||||
if max_height.is_some_and(|x| current_height > x) {
|
||||
return Err(Error::NoGitRepositoryWithinCeiling {
|
||||
path: dir.into_owned(),
|
||||
ceiling_height: current_height,
|
||||
@@ -168,7 +168,7 @@ pub(crate) mod function {
|
||||
}
|
||||
}
|
||||
}
|
||||
if cursor.parent().map_or(false, |p| p.as_os_str().is_empty()) {
|
||||
if cursor.parent().is_some_and(|p| p.as_os_str().is_empty()) {
|
||||
cursor = cwd.to_path_buf();
|
||||
dir_made_absolute = true;
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@ version = "0.39.1"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2021"
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
|
||||
[lib]
|
||||
|
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
|
||||
description = "A crate of the gitoxide project to read and write .git/FETCH_HEAD"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
|
||||
description = "A crate of the gitoxide project implementing git filters"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
|
||||
[lib]
|
||||
|
@@ -12,7 +12,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let mut args = std::env::args();
|
||||
let sub_command = args.nth(1).ok_or("Need sub-command")?;
|
||||
let next_arg = args.next(); // possibly %f
|
||||
let needs_failure = next_arg.as_deref().map_or(false, |file| file.ends_with("fail"));
|
||||
let needs_failure = next_arg.as_deref().is_some_and(|file| file.ends_with("fail"));
|
||||
if needs_failure {
|
||||
panic!("failure requested for {sub_command}");
|
||||
}
|
||||
@@ -40,7 +40,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
.meta
|
||||
.iter()
|
||||
.find_map(|(key, value)| (key == "pathname").then_some(value))
|
||||
.map_or(false, |path| path.ends_with(b"fail"));
|
||||
.is_some_and(|path| path.ends_with(b"fail"));
|
||||
let pathname = request
|
||||
.meta
|
||||
.iter()
|
||||
|
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
|
||||
description = "A crate providing file system specific utilities to `gitoxide`"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
|
||||
[lib]
|
||||
|
@@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0"
|
||||
description = "Verifies the connectivity and validity of objects in the database"
|
||||
edition = "2021"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
|
||||
description = "A crate of the gitoxide project dealing with pattern matching"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
|
||||
[lib]
|
||||
|
@@ -135,7 +135,7 @@ impl Pattern {
|
||||
value
|
||||
.len()
|
||||
.checked_sub(text.len())
|
||||
.map_or(false, |start| text.eq_ignore_ascii_case(&value[start..]))
|
||||
.is_some_and(|start| text.eq_ignore_ascii_case(&value[start..]))
|
||||
} else {
|
||||
value.ends_with(text.as_ref())
|
||||
}
|
||||
@@ -144,7 +144,7 @@ impl Pattern {
|
||||
if mode.contains(wildmatch::Mode::IGNORE_CASE) {
|
||||
if !value
|
||||
.get(..pos)
|
||||
.map_or(false, |value| value.eq_ignore_ascii_case(&self.text[..pos]))
|
||||
.is_some_and(|value| value.eq_ignore_ascii_case(&self.text[..pos]))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@@ -240,7 +240,7 @@ pub(crate) mod function {
|
||||
}
|
||||
BRACKET_OPEN if matches!(p.peek(), Some((_, COLON))) => {
|
||||
p.next();
|
||||
while p.peek().map_or(false, |t| t.1 != BRACKET_CLOSE) {
|
||||
while p.peek().is_some_and(|t| t.1 != BRACKET_CLOSE) {
|
||||
p.next();
|
||||
}
|
||||
let closing_bracket_idx = match p.next() {
|
||||
|
@@ -9,7 +9,7 @@ repository = "https://github.com/GitoxideLabs/gitoxide"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2021"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
@@ -9,7 +9,7 @@ description = "A crate that provides hashtable based data structures optimized t
|
||||
authors = ["Pascal Kuthe <pascal.kuthe@semimod.de>"]
|
||||
edition = "2021"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
@@ -9,7 +9,7 @@ description = "A crate of the gitoxide project dealing .gitignore files"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
@@ -9,7 +9,7 @@ description = "A work-in-progress crate of the gitoxide project dedicated implem
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
include = ["src/**/*", "LICENSE-*", "README.md"]
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
autotests = false
|
||||
|
||||
|
||||
|
@@ -331,8 +331,8 @@ impl State {
|
||||
.get(..prefix_len)
|
||||
.map_or_else(|| e.path(self) <= &prefix[..e.path.len()], |p| p < prefix)
|
||||
});
|
||||
let mut high = low
|
||||
+ self.entries[low..].partition_point(|e| e.path(self).get(..prefix_len).map_or(false, |p| p <= prefix));
|
||||
let mut high =
|
||||
low + self.entries[low..].partition_point(|e| e.path(self).get(..prefix_len).is_some_and(|p| p <= prefix));
|
||||
|
||||
let low_entry = &self.entries.get(low)?;
|
||||
if low_entry.stage_raw() != 0 {
|
||||
|
@@ -40,7 +40,7 @@ pub const SIGNATURE: Signature = *b"UNTR";
|
||||
// #[allow(unused)]
|
||||
/// Decode an untracked cache extension from `data`, assuming object hashes are of type `object_hash`.
|
||||
pub fn decode(data: &[u8], object_hash: gix_hash::Kind) -> Option<UntrackedCache> {
|
||||
if !data.last().map_or(false, |b| *b == 0) {
|
||||
if !data.last().is_some_and(|b| *b == 0) {
|
||||
return None;
|
||||
}
|
||||
let (identifier_len, data) = var_int(data)?;
|
||||
|
@@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0"
|
||||
description = "Integration tests for gix-index"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[[test]]
|
||||
name = "integrate"
|
||||
|
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
|
||||
description = "A crate of the gitoxide project dealing with handling git large file support"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
@@ -9,7 +9,7 @@ description = "A git-style lock-file implementation"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
include = ["src/**/*", "LICENSE-*", "README.md"]
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
@@ -13,7 +13,7 @@ authors = [
|
||||
repository = "https://github.com/GitoxideLabs/gitoxide"
|
||||
license = "MIT OR Apache-2.0"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[lib]
|
||||
proc-macro = true
|
||||
|
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
|
||||
description = "A crate of the gitoxide project for parsing mailmap files"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
|
||||
[lib]
|
||||
|
@@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0"
|
||||
description = "A crate of the gitoxide project implementing merge algorithms"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
@@ -233,10 +233,7 @@ impl Conflict {
|
||||
};
|
||||
match how.tree_merge {
|
||||
treat_as_unresolved::TreeMerge::Undecidable => {
|
||||
self.resolution.is_err()
|
||||
|| self
|
||||
.content_merge()
|
||||
.map_or(false, |info| content_merge_unresolved(&info))
|
||||
self.resolution.is_err() || self.content_merge().is_some_and(|info| content_merge_unresolved(&info))
|
||||
}
|
||||
treat_as_unresolved::TreeMerge::EvasiveRenames | treat_as_unresolved::TreeMerge::ForcedResolution => {
|
||||
match &self.resolution {
|
||||
@@ -246,13 +243,13 @@ impl Conflict {
|
||||
how.tree_merge == treat_as_unresolved::TreeMerge::ForcedResolution
|
||||
|| self
|
||||
.content_merge()
|
||||
.map_or(false, |merged_blob| content_merge_unresolved(&merged_blob))
|
||||
.is_some_and(|merged_blob| content_merge_unresolved(&merged_blob))
|
||||
}
|
||||
Resolution::OursModifiedTheirsRenamedAndChangedThenRename {
|
||||
merged_blob,
|
||||
final_location,
|
||||
..
|
||||
} => final_location.is_some() || merged_blob.as_ref().map_or(false, content_merge_unresolved),
|
||||
} => final_location.is_some() || merged_blob.as_ref().is_some_and(content_merge_unresolved),
|
||||
Resolution::OursModifiedTheirsModifiedThenBlobContentMerge { merged_blob } => {
|
||||
content_merge_unresolved(merged_blob)
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
|
||||
description = "A crate of the gitoxide project implementing negotiation algorithms"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
|
||||
[lib]
|
||||
|
@@ -148,7 +148,7 @@ impl Negotiator for Algorithm {
|
||||
fn in_common_with_remote(&mut self, id: ObjectId, graph: &mut crate::Graph<'_, '_>) -> Result<bool, Error> {
|
||||
let known_to_be_common = graph
|
||||
.get(&id)
|
||||
.map_or(false, |commit| commit.data.flags.contains(Flags::COMMON));
|
||||
.is_some_and(|commit| commit.data.flags.contains(Flags::COMMON));
|
||||
self.mark_common(id, Mark::ThisCommitAndAncestors, Ancestors::DirectUnseen, graph)?;
|
||||
Ok(known_to_be_common)
|
||||
}
|
||||
|
@@ -116,7 +116,7 @@ impl Negotiator for Algorithm {
|
||||
fn known_common(&mut self, id: ObjectId, graph: &mut crate::Graph<'_, '_>) -> Result<(), Error> {
|
||||
if graph
|
||||
.get(&id)
|
||||
.map_or(false, |commit| commit.data.flags.contains(Flags::SEEN))
|
||||
.is_some_and(|commit| commit.data.flags.contains(Flags::SEEN))
|
||||
{
|
||||
return Ok(());
|
||||
}
|
||||
@@ -126,7 +126,7 @@ impl Negotiator for Algorithm {
|
||||
fn add_tip(&mut self, id: ObjectId, graph: &mut crate::Graph<'_, '_>) -> Result<(), Error> {
|
||||
if graph
|
||||
.get(&id)
|
||||
.map_or(false, |commit| commit.data.flags.contains(Flags::SEEN))
|
||||
.is_some_and(|commit| commit.data.flags.contains(Flags::SEEN))
|
||||
{
|
||||
return Ok(());
|
||||
}
|
||||
@@ -168,7 +168,7 @@ impl Negotiator for Algorithm {
|
||||
|
||||
fn in_common_with_remote(&mut self, id: ObjectId, graph: &mut crate::Graph<'_, '_>) -> Result<bool, Error> {
|
||||
let mut was_seen = false;
|
||||
let known_to_be_common = graph.get(&id).map_or(false, |commit| {
|
||||
let known_to_be_common = graph.get(&id).is_some_and(|commit| {
|
||||
was_seen = commit.data.flags.contains(Flags::SEEN);
|
||||
commit.data.flags.contains(Flags::COMMON)
|
||||
});
|
||||
|
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
|
||||
description = "A crate of the gitoxide project dealing with git notes"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
@@ -9,7 +9,7 @@ repository = "https://github.com/GitoxideLabs/gitoxide"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2021"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
@@ -257,7 +257,7 @@ impl Editor<'_> {
|
||||
let mut path_buf = self.path_buf.borrow_mut();
|
||||
let mut cursor = self.trees.get_mut(path_buf.as_bstr()).expect("root is always present");
|
||||
let mut rela_path = rela_path.into_iter().peekable();
|
||||
let new_kind_is_tree = kind_and_id.map_or(false, |(kind, _, _)| kind == EntryKind::Tree);
|
||||
let new_kind_is_tree = kind_and_id.is_some_and(|(kind, _, _)| kind == EntryKind::Tree);
|
||||
while let Some(name) = rela_path.next() {
|
||||
let name = name.as_ref();
|
||||
if name.is_empty() {
|
||||
@@ -336,7 +336,7 @@ impl Editor<'_> {
|
||||
if needs_sorting {
|
||||
cursor.entries.sort();
|
||||
}
|
||||
if is_last && kind_and_id.map_or(false, |(_, _, mode)| mode == UpsertMode::Normal) {
|
||||
if is_last && kind_and_id.is_some_and(|(_, _, mode)| mode == UpsertMode::Normal) {
|
||||
break;
|
||||
}
|
||||
push_path_component(&mut path_buf, name);
|
||||
|
@@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0"
|
||||
description = "Implements various git object databases"
|
||||
edition = "2021"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
autotests = false
|
||||
|
||||
[lib]
|
||||
|
@@ -162,7 +162,7 @@ where
|
||||
T: gix_object::Exists,
|
||||
{
|
||||
fn exists(&self, id: &gix_hash::oid) -> bool {
|
||||
self.memory.as_ref().map_or(false, |map| map.borrow().contains_key(id)) || self.inner.exists(id)
|
||||
self.memory.as_ref().is_some_and(|map| map.borrow().contains_key(id)) || self.inner.exists(id)
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -8,7 +8,7 @@ authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
license = "MIT OR Apache-2.0"
|
||||
description = "Tests for gix-odb with feature-toggle support"
|
||||
edition = "2021"
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
publish = false
|
||||
|
||||
[features]
|
||||
|
@@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0"
|
||||
description = "Implements git packs and related data structures"
|
||||
edition = "2021"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
autotests = false
|
||||
|
||||
[lib]
|
||||
|
@@ -8,7 +8,7 @@ authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
license = "MIT OR Apache-2.0"
|
||||
description = "Please use `gix-<thiscrate>` instead ('git' -> 'gix')"
|
||||
edition = "2021"
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[features]
|
||||
gix-features-parallel = ["gix-features/parallel"]
|
||||
|
@@ -9,7 +9,7 @@ description = "A duplicate of `gix-packetline` with the `blocking-io` feature pr
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
@@ -9,7 +9,7 @@ description = "A crate of the gitoxide project implementing the pkt-line seriali
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
@@ -9,7 +9,7 @@ description = "A crate of the gitoxide project dealing paths and their conversio
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
|
||||
description = "A crate of the gitoxide project dealing magical pathspecs"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
include = ["src/**/*", "LICENSE-*", "README.md"]
|
||||
|
||||
[lib]
|
||||
|
@@ -644,7 +644,7 @@ mod baseline {
|
||||
attrs.pattern_matching_relative_path(rela_path, case, Some(is_dir), out)
|
||||
},
|
||||
)
|
||||
.map_or(false, |m| !m.is_excluded())
|
||||
.is_some_and(|m| !m.is_excluded())
|
||||
})
|
||||
.cloned()
|
||||
.collect();
|
||||
|
@@ -9,7 +9,7 @@ description = "A crate of the gitoxide project for handling prompts in the termi
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
include = ["src/**/*", "LICENSE-*", "README.md"]
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
@@ -9,7 +9,7 @@ description = "A crate of the gitoxide project for implementing git protocols"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
include = ["src/**/*", "LICENSE-*", "!**/tests/**/*"]
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
@@ -181,7 +181,7 @@ where
|
||||
{
|
||||
remote_ref_target_known[mapping_idx] = true;
|
||||
cutoff_date = cutoff_date.unwrap_or_default().max(commit.commit_time).into();
|
||||
} else if want_id.map_or(false, |maybe_annotated_tag| objects.exists(maybe_annotated_tag)) {
|
||||
} else if want_id.is_some_and(|maybe_annotated_tag| objects.exists(maybe_annotated_tag)) {
|
||||
remote_ref_target_known[mapping_idx] = true;
|
||||
}
|
||||
}
|
||||
@@ -263,12 +263,12 @@ pub fn make_refmapping_ignore_predicate(fetch_tags: Tags, ref_map: &RefMap) -> i
|
||||
.then(|| fetch_tags.to_refspec())
|
||||
.flatten();
|
||||
move |mapping| {
|
||||
tag_refspec_to_ignore.map_or(false, |tag_spec| {
|
||||
tag_refspec_to_ignore.is_some_and(|tag_spec| {
|
||||
mapping
|
||||
.spec_index
|
||||
.implicit_index()
|
||||
.and_then(|idx| ref_map.extra_refspecs.get(idx))
|
||||
.map_or(false, |spec| spec.to_ref() == tag_spec)
|
||||
.is_some_and(|spec| spec.to_ref() == tag_spec)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
|
||||
description = "A crate of the gitoxide project dealing with various quotations used by git"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
|
||||
[lib]
|
||||
|
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
|
||||
description = "A crate of the gitoxide project dealing rebases"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
@@ -9,7 +9,7 @@ description = "A crate to handle git references"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
autotests = false
|
||||
|
||||
[lib]
|
||||
|
@@ -232,7 +232,7 @@ impl file::Store {
|
||||
MainRef | MainPseudoRef => (commondir.into(), sn),
|
||||
LinkedRef { name: worktree_name } => sn
|
||||
.category()
|
||||
.map_or(false, |cat| cat.is_worktree_private())
|
||||
.is_some_and(|cat| cat.is_worktree_private())
|
||||
.then(|| {
|
||||
if is_reflog {
|
||||
(linked_git_dir(worktree_name).into(), sn)
|
||||
|
@@ -37,7 +37,7 @@ impl Iterator for SortedLoosePaths {
|
||||
for entry in self.file_walk.as_mut()?.by_ref() {
|
||||
match entry {
|
||||
Ok(entry) => {
|
||||
if !entry.file_type().map_or(false, |ft| ft.is_file()) {
|
||||
if !entry.file_type().is_ok_and(|ft| ft.is_file()) {
|
||||
continue;
|
||||
}
|
||||
let full_path = entry.path().into_owned();
|
||||
|
@@ -118,7 +118,7 @@ impl Iterator for LooseThenPacked<'_, '_> {
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
fn advance_to_non_private(iter: &mut Peekable<SortedLoosePaths>) {
|
||||
while let Some(Ok((_path, name))) = iter.peek() {
|
||||
if name.category().map_or(false, |cat| cat.is_worktree_private()) {
|
||||
if name.category().is_some_and(|cat| cat.is_worktree_private()) {
|
||||
iter.next();
|
||||
} else {
|
||||
break;
|
||||
|
@@ -430,7 +430,7 @@ fn possibly_adjust_name_for_prefixes(name: &FullNameRef) -> Option<FullName> {
|
||||
Tag | LocalBranch | RemoteBranch | Note => name.into(),
|
||||
MainRef | LinkedRef { .. } => sn
|
||||
.category()
|
||||
.map_or(false, |cat| !cat.is_worktree_private())
|
||||
.is_some_and(|cat| !cat.is_worktree_private())
|
||||
.then_some(sn),
|
||||
}
|
||||
.map(ToOwned::to_owned)
|
||||
|
@@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0"
|
||||
description = "Test the gix-ref crate with feature toggles"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[features]
|
||||
gix-features-parallel = ["gix-features/parallel"] # test sorted parallel loose file traversal
|
||||
|
@@ -9,7 +9,7 @@ description = "A crate of the gitoxide project for parsing and representing refs
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
include = ["src/**/*", "LICENSE-*", "README.md"]
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
@@ -9,7 +9,7 @@ description = "A crate of the gitoxide project dealing with finding names for re
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
include = ["src/**/*", "LICENSE-*", "README.md"]
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
@@ -162,11 +162,10 @@ fn paint_down_to_common(
|
||||
}
|
||||
|
||||
let mut out = Vec::new();
|
||||
while queue.iter_unordered().any(|id| {
|
||||
graph
|
||||
.get(id)
|
||||
.map_or(false, |commit| !commit.data.contains(Flags::STALE))
|
||||
}) {
|
||||
while queue
|
||||
.iter_unordered()
|
||||
.any(|id| graph.get(id).is_some_and(|commit| !commit.data.contains(Flags::STALE)))
|
||||
{
|
||||
let (info, commit_id) = queue.pop().expect("we have non-stale");
|
||||
let commit = graph.get_mut(&commit_id).expect("everything queued is in graph");
|
||||
let mut flags_without_result = commit.data & (Flags::COMMIT1 | Flags::COMMIT2 | Flags::STALE);
|
||||
|
@@ -355,7 +355,7 @@ where
|
||||
if *pos != 0 && (next, next_next) == (Some(&b'.'), Some(&b'.')) {
|
||||
return false;
|
||||
}
|
||||
next == Some(&b'{') || next.map_or(false, |b| SEPARATORS.contains(b))
|
||||
next == Some(&b'{') || next.is_some_and(|b| SEPARATORS.contains(b))
|
||||
} else if SEPARATORS.contains(b) {
|
||||
true
|
||||
} else {
|
||||
|
@@ -9,7 +9,7 @@ description = "A crate providing utilities for walking the revision graph"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
@@ -9,7 +9,7 @@ description = "A crate of the gitoxide project providing a shared trust model"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
|
||||
description = "A crate of the gitoxide project handling sequences of human-aided operations"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
@@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0"
|
||||
description = "Handle files specifying the shallow boundary"
|
||||
edition = "2021"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
@@ -9,7 +9,7 @@ description = "A crate of the gitoxide project dealing with 'git status'-like fu
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>", "Pascal Kuthe <pascal.kuthe@semimod.de>"]
|
||||
edition = "2021"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
autotests = false
|
||||
|
||||
[lib]
|
||||
|
@@ -277,7 +277,7 @@ impl<'index> State<'_, 'index> {
|
||||
self.attr_stack
|
||||
.set_case(case)
|
||||
.at_entry(relative_path, Some(is_dir_to_mode(is_dir)), objects)
|
||||
.map_or(false, |platform| platform.matching_attributes(out))
|
||||
.is_ok_and(|platform| platform.matching_attributes(out))
|
||||
},
|
||||
)
|
||||
.map_or(true, |m| m.is_excluded());
|
||||
|
@@ -101,7 +101,7 @@ pub(super) mod function {
|
||||
stack
|
||||
.set_case(case)
|
||||
.at_entry(relative_path, Some(is_dir_to_mode(is_dir)), &objects)
|
||||
.map_or(false, |platform| platform.matching_attributes(out))
|
||||
.is_ok_and(|platform| platform.matching_attributes(out))
|
||||
},
|
||||
excludes: excludes.as_mut(),
|
||||
objects: &objects,
|
||||
|
@@ -9,7 +9,7 @@ description = "A crate to drive gix-status tests with different features"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>", "Pascal Kuthe <pascal.kuthe@semimod.de>"]
|
||||
edition = "2021"
|
||||
publish = false
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[[test]]
|
||||
name = "status"
|
||||
|
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
|
||||
description = "A crate of the gitoxide project dealing git submodules"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
|
||||
[lib]
|
||||
|
@@ -40,7 +40,7 @@ impl IsActivePlatform {
|
||||
if let Some(val) = self.search.as_mut().map(|search| {
|
||||
search
|
||||
.pattern_matching_relative_path(name, Some(true), attributes)
|
||||
.map_or(false, |m| !m.is_excluded())
|
||||
.is_some_and(|m| !m.is_excluded())
|
||||
}) {
|
||||
return Ok(val);
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@ description = "A tempfile implementation with a global registry to assure cleanu
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
include = ["src/**/*", "LICENSE-*", "README.md"]
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[[example]]
|
||||
name = "delete-tempfiles-on-sigterm"
|
||||
|
@@ -21,10 +21,7 @@ pub fn cleanup_tempfiles_signal_safe() {
|
||||
for idx in 0..one_past_last_index {
|
||||
if let Some(entry) = REGISTRY.try_entry(idx) {
|
||||
entry.and_modify(|tempfile| {
|
||||
if tempfile
|
||||
.as_ref()
|
||||
.map_or(false, |tf| tf.owning_process_id == current_pid)
|
||||
{
|
||||
if tempfile.as_ref().is_some_and(|tf| tf.owning_process_id == current_pid) {
|
||||
if let Some(tempfile) = tempfile.take() {
|
||||
tempfile.drop_without_deallocation();
|
||||
}
|
||||
@@ -55,7 +52,7 @@ pub fn cleanup_tempfiles() {
|
||||
let current_pid = std::process::id();
|
||||
#[cfg(feature = "hp-hashmap")]
|
||||
REGISTRY.iter_mut().for_each(|mut tf| {
|
||||
if tf.as_ref().map_or(false, |tf| tf.owning_process_id == current_pid) {
|
||||
if tf.as_ref().is_some_and(|tf| tf.owning_process_id == current_pid) {
|
||||
tf.take();
|
||||
}
|
||||
});
|
||||
|
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
|
||||
description = "A tool like `tig`, but minimal, fast and efficient"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
@@ -8,7 +8,7 @@ version = "0.1.11"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2021"
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
|
||||
[lib]
|
||||
|
@@ -9,7 +9,7 @@ description = "A crate of the gitoxide project dedicated to implementing the git
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
@@ -281,7 +281,7 @@ impl<H: Http> Transport<H> {
|
||||
let wanted_content_type = format!("application/x-{}-{}", service.as_str(), kind);
|
||||
if !headers.lines().collect::<Result<Vec<_>, _>>()?.iter().any(|l| {
|
||||
let mut tokens = l.split(':');
|
||||
tokens.next().zip(tokens.next()).map_or(false, |(name, value)| {
|
||||
tokens.next().zip(tokens.next()).is_some_and(|(name, value)| {
|
||||
name.eq_ignore_ascii_case("content-type") && value.trim() == wanted_content_type
|
||||
})
|
||||
}) {
|
||||
|
@@ -27,7 +27,7 @@ impl crate::IsSpuriousError for Error {
|
||||
fn is_spurious(&self) -> bool {
|
||||
match self {
|
||||
Error::Reqwest(err) => {
|
||||
err.is_timeout() || err.is_connect() || err.status().map_or(false, |status| status.is_server_error())
|
||||
err.is_timeout() || err.is_connect() || err.status().is_some_and(|status| status.is_server_error())
|
||||
}
|
||||
_ => false,
|
||||
}
|
||||
|
@@ -125,7 +125,7 @@ pub fn connect(
|
||||
}),
|
||||
);
|
||||
gix_features::trace::debug!(cmd = ?cmd, "invoking `ssh` for feature check");
|
||||
kind = if cmd.status().ok().map_or(false, |status| status.success()) {
|
||||
kind = if cmd.status().ok().is_some_and(|status| status.success()) {
|
||||
ProgramKind::Ssh
|
||||
} else {
|
||||
ProgramKind::Simple
|
||||
|
@@ -9,7 +9,7 @@ description = "A crate of the gitoxide project"
|
||||
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
|
||||
edition = "2021"
|
||||
include = ["src/**/*", "LICENSE-*"]
|
||||
rust-version = "1.65"
|
||||
rust-version = "1.70"
|
||||
autotests = false
|
||||
|
||||
[lib]
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user