History

Merge branch 'patch-1'

Sebastian Thiel committed 3 years ago

Commit b93f0c42 parents ffb5b6a 4fc214a91 files · +308 −338Browse files

Unified · Split

91 files
  1. .github/workflows/msrv.yml +1 −1
  2. Cargo.lock +90 −177
  3. Cargo.toml +1 −1
  4. cargo-smart-release/Cargo.toml +3 −3
  5. cargo-smart-release/src/changelog/section/from_history.rs +2 −1
  6. cargo-smart-release/src/command/changelog.rs +7 −5
  7. cargo-smart-release/src/command/release/manifest.rs +1 −1
  8. cargo-smart-release/src/command/release/mod.rs +6 −6
  9. cargo-smart-release/src/commit/message.rs +1 −1
  10. cargo-smart-release/src/git/mod.rs +2 −2
  11. cargo-smart-release/src/traverse.rs +10 −8
  12. clippy.toml +1 −1
  13. etc/msrv-badge.svg +1 −1
  14. git-attributes/src/match_group.rs +4 −4
  15. git-config/Cargo.toml +1 −1
  16. git-config/src/file/access/mutate.rs +1 −0
  17. git-config/src/file/access/read_only.rs +2 −2
  18. git-config/src/file/includes/mod.rs +1 −1
  19. git-config/src/file/init/comfort.rs +1 −1
  20. git-config/src/file/mutable/section.rs +1 −1
  21. git-config/src/file/section/body.rs +1 −1
  22. git-config/src/file/util.rs +1 −1
  23. git-config/src/file/write.rs +1 −1
  24. git-config/src/parse/nom/mod.rs +1 −1
  25. git-config/src/parse/section/header.rs +2 −2
  26. git-config/tests/file/init/from_paths/includes/conditional/mod.rs +5 −2
  27. git-date/tests/time/baseline.rs +1 −1
  28. git-discover/Cargo.toml +1 −1
  29. git-discover/src/upwards/mod.rs +1 −1
  30. git-features/src/lib.rs +1 −1
  31. git-features/src/parallel/in_parallel.rs +1 −1
  32. git-glob/src/wildmatch.rs +1 −4
  33. git-index/src/extension/index_entry_offset_table.rs +1 −1
  34. git-index/src/extension/tree/verify.rs +1 −1
  35. git-index/src/extension/untracked_cache.rs +3 −3
  36. git-index/src/file/verify.rs +1 −1
  37. git-index/src/write.rs +1 −1
  38. git-mailmap/src/parse.rs +1 −1
  39. git-mailmap/src/snapshot/signature.rs +1 −1
  40. git-odb/src/store_impls/dynamic/handle.rs +2 −2
  41. git-odb/src/store_impls/dynamic/load_index.rs +4 −4
  42. git-pack/src/data/input/lookup_ref_delta_objects.rs +2 −1
  43. git-pack/src/data/output/entry/iter_from_counts.rs +1 −1
  44. git-pack/src/multi_index/chunk.rs +2 −2
  45. git-pack/src/multi_index/init.rs +3 −3
  46. git-pack/src/verify.rs +1 −1
  47. git-prompt/Cargo.toml +2 −2
  48. git-prompt/src/types.rs +1 −1
  49. git-protocol/tests/fetch/response.rs +1 −1
  50. git-protocol/tests/fetch/v1.rs +1 −1
  51. git-ref/src/store/file/transaction/prepare.rs +1 −1
  52. git-refspec/src/match_group/mod.rs +1 −1
  53. git-refspec/src/match_group/util.rs +1 −1
  54. git-refspec/src/match_group/validate.rs +5 −3
  55. git-refspec/src/parse.rs +1 −1
  56. git-refspec/src/spec.rs +1 −1
  57. git-repository/Cargo.toml +2 −2
  58. git-repository/src/config/cache/incubate.rs +1 −1
  59. git-repository/src/config/cache/util.rs +9 −6
  60. git-repository/src/config/snapshot/credential_helpers.rs +3 −2
  61. git-repository/src/create.rs +5 −2
  62. git-repository/src/remote/connection/fetch/mod.rs +6 −2
  63. git-repository/src/remote/save.rs +1 −1
  64. git-repository/src/remote/url/rewrite.rs +1 −1
  65. git-repository/src/repository/config/transport.rs +5 −2
  66. git-repository/src/revision/spec/parse/delegate/mod.rs +1 −1
  67. git-repository/src/worktree/mod.rs +2 −2
  68. git-repository/tests/revision/spec/from_bytes/util.rs +1 −1
  69. git-revision/src/spec/parse/function.rs +3 −3
  70. git-sec/Cargo.toml +1 −1
  71. git-sec/src/identity.rs +10 −2
  72. git-sec/src/trust.rs +5 −3
  73. git-tempfile/src/fs/remove_dir.rs +1 −1
  74. git-transport/Cargo.toml +1 −1
  75. git-transport/src/client/blocking_io/file.rs +1 −1
  76. git-transport/src/client/blocking_io/http/curl/remote.rs +5 −3
  77. git-transport/src/client/blocking_io/http/mod.rs +3 −2
  78. git-transport/src/client/blocking_io/ssh/mod.rs +6 −3
  79. git-url/src/parse.rs +1 −1
  80. git-worktree/src/fs/cache/mod.rs +1 −1
  81. git-worktree/src/fs/cache/state.rs +1 −1
  82. gitoxide-core/src/hours/mod.rs +3 −3
  83. gitoxide-core/src/index/checkout.rs +1 −1
  84. gitoxide-core/src/repository/clone.rs +5 −2
  85. gitoxide-core/src/repository/config.rs +1 −1
  86. gitoxide-core/src/repository/exclude.rs +1 −1
  87. gitoxide-core/src/repository/remote.rs +7 −3
  88. gitoxide-core/src/repository/tree.rs +3 −3
  89. src/plumbing/main.rs +2 −2
  90. src/plumbing/progress.rs +15 −4
  91. tests/tools/src/lib.rs +1 −1
.github/workflows/msrv.yml+1−1
@@ -20,7 +20,7 @@ jobs: · 19 unmodified lines
20 runs-on: ${{ matrix.os }}20 runs-on: ${{ matrix.os }}
21 steps:21 steps:
22 - uses: actions/checkout@v322 - uses: actions/checkout@v3
23 - uses: dtolnay/rust-toolchain@1.60.0 # dictated by `windows` crates effectively, IMPORTANT: adjust etc/msrv-badge.svg as well23 - uses: dtolnay/rust-toolchain@1.64.0 # dictated by `windows` crates effectively, IMPORTANT: adjust etc/msrv-badge.svg as well
24 - run: make check-msrv-on-ci24 - run: make check-msrv-on-ci
25 continue-on-error: true # TODO: turn this off once the toolchain gets updated. There is a strange error preventing cargo to select the correct libgit2 version25 continue-on-error: true # TODO: turn this off once the toolchain gets updated. There is a strange error preventing cargo to select the correct libgit2 version
26 # like it doesn't exist.26 # like it doesn't exist.
Cargo.lock+90−177
@@ -129,7 +129,7 @@ dependencies = [ · 128 unmodified lines
129 "slab",129 "slab",
130 "socket2",130 "socket2",
131 "waker-fn",131 "waker-fn",
132 "windows-sys 0.42.0",132 "windows-sys",
133]133]
134 134
135[[package]]135[[package]]
@@ -189,9 +189,9 @@ checksum = "7a40729d2133846d9ed0ea60a8b9541bccddab49cd30f0715a1da672fe9a2524" · 53 unmodified lines
189 189
190[[package]]190[[package]]
191name = "async-trait"191name = "async-trait"
192version = "0.1.60"192version = "0.1.61"
193source = "registry+https://github.com/rust-lang/crates.io-index"193source = "registry+https://github.com/rust-lang/crates.io-index"
194checksum = "677d1d8ab452a3936018a687b20e6f7cf5363d713b732b8884001317b0e48aa3"194checksum = "705339e0e4a9690e2908d2b3d049d85682cf19fbd5782494498fbf7003a6a282"
195dependencies = [195dependencies = [
196 "proc-macro2",196 "proc-macro2",
197 "quote",197 "quote",
@@ -236,6 +236,12 @@ version = "0.13.1" · 38 unmodified lines
236source = "registry+https://github.com/rust-lang/crates.io-index"236source = "registry+https://github.com/rust-lang/crates.io-index"
237checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"237checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"
238 238
239[[package]]
240name = "base64"
241version = "0.21.0"
242source = "registry+https://github.com/rust-lang/crates.io-index"
243checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a"
244
239[[package]]245[[package]]
240name = "bitflags"246name = "bitflags"
241version = "1.3.2"247version = "1.3.2"
@@ -315,9 +321,9 @@ dependencies = [ · 73 unmodified lines
315 321
316[[package]]322[[package]]
317name = "camino"323name = "camino"
318version = "1.1.1"324version = "1.1.2"
319source = "registry+https://github.com/rust-lang/crates.io-index"325source = "registry+https://github.com/rust-lang/crates.io-index"
320checksum = "88ad0e1e3e88dd237a156ab9f571021b8a158caa0ae44b1968a241efb5144c1e"326checksum = "c77df041dc383319cc661b428b6961a005db4d6808d5e12536931b1ca9556055"
321dependencies = [327dependencies = [
322 "serde",328 "serde",
323]329]
@@ -341,7 +347,7 @@ dependencies = [ · 17 unmodified lines
341 "cargo_toml",347 "cargo_toml",
342 "clap",348 "clap",
343 "crates-index",349 "crates-index",
344 "env_logger 0.9.3",350 "env_logger",
345 "git-conventional",351 "git-conventional",
346 "git-repository",352 "git-repository",
347 "git-testtools",353 "git-testtools",
@@ -371,12 +377,11 @@ dependencies = [ · 23 unmodified lines
371 377
372[[package]]378[[package]]
373name = "cargo_toml"379name = "cargo_toml"
374version = "0.11.8"380version = "0.14.0"
375source = "registry+https://github.com/rust-lang/crates.io-index"381source = "registry+https://github.com/rust-lang/crates.io-index"
376checksum = "e72c3ff59e3b7d24630206bb63a73af65da4ed5df1f76ee84dfafb9fee2ba60e"382checksum = "0f1204fe51a1e56042b8ec31d6407547ecd18f596b66f470dadb9abd9be9c843"
377dependencies = [383dependencies = [
378 "serde",384 "serde",
379 "serde_derive",
380 "toml",385 "toml",
381]386]
382 387
@@ -497,16 +502,6 @@ dependencies = [ · 114 unmodified lines
497 "cc",502 "cc",
498]503]
499 504
500[[package]]
501name = "combine"
502version = "4.6.6"
503source = "registry+https://github.com/rust-lang/crates.io-index"
504checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4"
505dependencies = [
506 "bytes",
507 "memchr",
508]
509
510[[package]]505[[package]]
511name = "compact_str"506name = "compact_str"
512version = "0.6.1"507version = "0.6.1"
@@ -539,14 +534,14 @@ dependencies = [ · 26 unmodified lines
539 534
540[[package]]535[[package]]
541name = "console"536name = "console"
542version = "0.15.3"537version = "0.15.4"
543source = "registry+https://github.com/rust-lang/crates.io-index"538source = "registry+https://github.com/rust-lang/crates.io-index"
544checksum = "5556015fe3aad8b968e5d4124980fbe2f6aaee7aeec6b749de1faaa2ca5d0a4c"539checksum = "c9b6515d269224923b26b5febea2ed42b2d5f2ce37284a4dd670fedd6cb8347a"
545dependencies = [540dependencies = [
546 "encode_unicode",541 "encode_unicode",
547 "lazy_static",542 "lazy_static",
548 "libc",543 "libc",
549 "windows-sys 0.42.0",544 "windows-sys",
550]545]
551 546
552[[package]]547[[package]]
@@ -923,18 +918,6 @@ dependencies = [ · 370 unmodified lines
923 "syn",918 "syn",
924]919]
925 920
926[[package]]
927name = "env_logger"
928version = "0.9.3"
929source = "registry+https://github.com/rust-lang/crates.io-index"
930checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7"
931dependencies = [
932 "atty",
933 "humantime",
934 "log",
935 "termcolor",
936]
937
938[[package]]921[[package]]
939name = "env_logger"922name = "env_logger"
940version = "0.10.0"923version = "0.10.0"
@@ -976,12 +959,12 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" · 35 unmodified lines
976 959
977[[package]]960[[package]]
978name = "expectrl"961name = "expectrl"
979version = "0.5.2"962version = "0.6.0"
980source = "registry+https://github.com/rust-lang/crates.io-index"963source = "registry+https://github.com/rust-lang/crates.io-index"
981checksum = "2795e11f4ee3124984d454f25ac899515a5fa6d956562ef2b147fef6050b02f8"964checksum = "1ae3a1de9c4a0cfc3badf6f98bf0736fe3f05e3b6da5b8f5288a4726fcc6f746"
982dependencies = [965dependencies = [
983 "conpty",966 "conpty",
984 "nix 0.23.2",967 "nix 0.25.1",
985 "ptyprocess",968 "ptyprocess",
986 "regex",969 "regex",
987]970]
@@ -1004,7 +987,7 @@ dependencies = [ · 16 unmodified lines
1004 "cfg-if",987 "cfg-if",
1005 "libc",988 "libc",
1006 "redox_syscall",989 "redox_syscall",
1007 "windows-sys 0.42.0",990 "windows-sys",
1008]991]
1009 992
1010[[package]]993[[package]]
@@ -1767,7 +1750,7 @@ dependencies = [ · 756 unmodified lines
1767 "libc",1750 "libc",
1768 "serde",1751 "serde",
1769 "tempfile",1752 "tempfile",
1770 "windows 0.40.0",1753 "windows 0.43.0",
1771]1754]
1772 1755
1773[[package]]1756[[package]]
@@ -1823,7 +1806,7 @@ version = "0.25.2" · 49 unmodified lines
1823dependencies = [1806dependencies = [
1824 "async-std",1807 "async-std",
1825 "async-trait",1808 "async-trait",
1826 "base64",1809 "base64 0.21.0",
1827 "blocking",1810 "blocking",
1828 "bstr",1811 "bstr",
1829 "curl",1812 "curl",
@@ -1930,7 +1913,7 @@ dependencies = [ · 100 unmodified lines
1930 "clap",1913 "clap",
1931 "crosstermion",1914 "crosstermion",
1932 "document-features",1915 "document-features",
1933 "env_logger 0.10.0",1916 "env_logger",
1934 "futures-lite",1917 "futures-lite",
1935 "git-features",1918 "git-features",
1936 "git-repository",1919 "git-repository",
@@ -2212,9 +2195,9 @@ dependencies = [ · 275 unmodified lines
2212 2195
2213[[package]]2196[[package]]
2214name = "insta"2197name = "insta"
2215version = "1.23.0"2198version = "1.26.0"
2216source = "registry+https://github.com/rust-lang/crates.io-index"2199source = "registry+https://github.com/rust-lang/crates.io-index"
2217checksum = "e48b08a091dfe5b09a6a9688c468fdd5b4396e92ce09e2eb932f0884b02788a4"2200checksum = "f6f0f08b46e4379744de2ab67aa8f7de3ffd1da3e275adc41fcc82053ede46ff"
2218dependencies = [2201dependencies = [
2219 "console",2202 "console",
2220 "lazy_static",2203 "lazy_static",
@@ -2249,7 +2232,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" · 28 unmodified lines
2249checksum = "46112a93252b123d31a119a8d1a1ac19deac4fac6e0e8b0df58f0d4e5870e63c"2232checksum = "46112a93252b123d31a119a8d1a1ac19deac4fac6e0e8b0df58f0d4e5870e63c"
2250dependencies = [2233dependencies = [
2251 "libc",2234 "libc",
2252 "windows-sys 0.42.0",2235 "windows-sys",
2253]2236]
2254 2237
2255[[package]]2238[[package]]
@@ -2266,9 +2249,9 @@ dependencies = [ · 10 unmodified lines
2266 2249
2267[[package]]2250[[package]]
2268name = "ipnet"2251name = "ipnet"
2269version = "2.7.0"2252version = "2.7.1"
2270source = "registry+https://github.com/rust-lang/crates.io-index"2253source = "registry+https://github.com/rust-lang/crates.io-index"
2271checksum = "11b0d96e660696543b251e58030cf9787df56da39dab19ad60eae7353040917e"2254checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146"
2272 2255
2273[[package]]2256[[package]]
2274name = "is-terminal"2257name = "is-terminal"
@@ -2279,7 +2262,7 @@ dependencies = [ · 4 unmodified lines
2279 "hermit-abi 0.2.6",2262 "hermit-abi 0.2.6",
2280 "io-lifetimes",2263 "io-lifetimes",
2281 "rustix",2264 "rustix",
2282 "windows-sys 0.42.0",2265 "windows-sys",
2283]2266]
2284 2267
2285[[package]]2268[[package]]
@@ -2548,7 +2531,7 @@ dependencies = [ · 262 unmodified lines
2548 "libc",2531 "libc",
2549 "log",2532 "log",
2550 "wasi",2533 "wasi",
2551 "windows-sys 0.42.0",2534 "windows-sys",
2552]2535]
2553 2536
2554[[package]]2537[[package]]
@@ -2584,15 +2567,16 @@ dependencies = [ · 29 unmodified lines
2584 2567
2585[[package]]2568[[package]]
2586name = "nix"2569name = "nix"
2587version = "0.23.2"2570version = "0.25.1"
2588source = "registry+https://github.com/rust-lang/crates.io-index"2571source = "registry+https://github.com/rust-lang/crates.io-index"
2589checksum = "8f3790c00a0150112de0f4cd161e3d7fc4b2d8a5542ffc35f099a2562aecb35c"2572checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4"
2590dependencies = [2573dependencies = [
2574 "autocfg",
2591 "bitflags",2575 "bitflags",
2592 "cc",
2593 "cfg-if",2576 "cfg-if",
2594 "libc",2577 "libc",
2595 "memoffset 0.6.5",2578 "memoffset 0.6.5",
2579 "pin-utils",
2596]2580]
2597 2581
2598[[package]]2582[[package]]
@@ -2609,14 +2593,23 @@ dependencies = [ · 10 unmodified lines
2609 2593
2610[[package]]2594[[package]]
2611name = "nom"2595name = "nom"
2612version = "7.1.1"2596version = "7.1.2"
2613source = "registry+https://github.com/rust-lang/crates.io-index"2597source = "registry+https://github.com/rust-lang/crates.io-index"
2614checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36"2598checksum = "e5507769c4919c998e69e49c839d9dc6e693ede4cc4290d6ad8b41d4f09c548c"
2615dependencies = [2599dependencies = [
2616 "memchr",2600 "memchr",
2617 "minimal-lexical",2601 "minimal-lexical",
2618]2602]
2619 2603
2604[[package]]
2605name = "nom8"
2606version = "0.2.0"
2607source = "registry+https://github.com/rust-lang/crates.io-index"
2608checksum = "ae01545c9c7fc4486ab7debaf2aad7003ac19431791868fb2e8066df97fad2f8"
2609dependencies = [
2610 "memchr",
2611]
2612
2620[[package]]2613[[package]]
2621name = "num-traits"2614name = "num-traits"
2622version = "0.2.15"2615version = "0.2.15"
@@ -2725,9 +2718,9 @@ checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" · 102 unmodified lines
2725 2718
2726[[package]]2719[[package]]
2727name = "papergrid"2720name = "papergrid"
2728version = "0.5.1"2721version = "0.7.1"
2729source = "registry+https://github.com/rust-lang/crates.io-index"2722source = "registry+https://github.com/rust-lang/crates.io-index"
2730checksum = "453cf71f2a37af495a1a124bf30d4d7469cfbea58e9f2479be9d222396a518a2"2723checksum = "1526bb6aa9f10ec339fb10360f22c57edf81d5678d0278e93bc12a47ffbe4b01"
2731dependencies = [2724dependencies = [
2732 "bytecount",2725 "bytecount",
2733 "fnv",2726 "fnv",
@@ -2785,7 +2778,7 @@ dependencies = [ · 51 unmodified lines
2785 "libc",2778 "libc",
2786 "redox_syscall",2779 "redox_syscall",
2787 "smallvec",2780 "smallvec",
2788 "windows-sys 0.42.0",2781 "windows-sys",
2789]2782]
2790 2783
2791[[package]]2784[[package]]
@@ -2851,7 +2844,7 @@ dependencies = [ · 59 unmodified lines
2851 "libc",2844 "libc",
2852 "log",2845 "log",
2853 "wepoll-ffi",2846 "wepoll-ffi",
2854 "windows-sys 0.42.0",2847 "windows-sys",
2855]2848]
2856 2849
2857[[package]]2850[[package]]
@@ -3046,9 +3039,9 @@ dependencies = [ · 188 unmodified lines
3046 3039
3047[[package]]3040[[package]]
3048name = "regex"3041name = "regex"
3049version = "1.7.0"3042version = "1.7.1"
3050source = "registry+https://github.com/rust-lang/crates.io-index"3043source = "registry+https://github.com/rust-lang/crates.io-index"
3051checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a"3044checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733"
3052dependencies = [3045dependencies = [
3053 "aho-corasick",3046 "aho-corasick",
3054 "memchr",3047 "memchr",
@@ -3082,7 +3075,7 @@ version = "0.11.13" · 27 unmodified lines
3082source = "registry+https://github.com/rust-lang/crates.io-index"3075source = "registry+https://github.com/rust-lang/crates.io-index"
3083checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c"3076checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c"
3084dependencies = [3077dependencies = [
3085 "base64",3078 "base64 0.13.1",
3086 "bytes",3079 "bytes",
3087 "encoding_rs",3080 "encoding_rs",
3088 "futures-core",3081 "futures-core",
@@ -3161,7 +3154,7 @@ dependencies = [ · 72 unmodified lines
3161 "io-lifetimes",3154 "io-lifetimes",
3162 "libc",3155 "libc",
3163 "linux-raw-sys",3156 "linux-raw-sys",
3164 "windows-sys 0.42.0",3157 "windows-sys",
3165]3158]
3166 3159
3167[[package]]3160[[package]]
@@ -3182,7 +3175,7 @@ version = "1.0.1" · 14 unmodified lines
3182source = "registry+https://github.com/rust-lang/crates.io-index"3175source = "registry+https://github.com/rust-lang/crates.io-index"
3183checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55"3176checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55"
3184dependencies = [3177dependencies = [
3185 "base64",3178 "base64 0.13.1",
3186]3179]
3187 3180
3188[[package]]3181[[package]]
@@ -3208,12 +3201,11 @@ dependencies = [ · 19 unmodified lines
3208 3201
3209[[package]]3202[[package]]
3210name = "schannel"3203name = "schannel"
3211version = "0.1.20"3204version = "0.1.21"
3212source = "registry+https://github.com/rust-lang/crates.io-index"3205source = "registry+https://github.com/rust-lang/crates.io-index"
3213checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2"3206checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3"
3214dependencies = [3207dependencies = [
3215 "lazy_static",3208 "windows-sys",
3216 "windows-sys 0.36.1",
3217]3209]
3218 3210
3219[[package]]3211[[package]]
@@ -3309,9 +3301,9 @@ dependencies = [ · 89 unmodified lines
3309 3301
3310[[package]]3302[[package]]
3311name = "serial_test"3303name = "serial_test"
3312version = "0.9.0"3304version = "0.10.0"
3313source = "registry+https://github.com/rust-lang/crates.io-index"3305source = "registry+https://github.com/rust-lang/crates.io-index"
3314checksum = "92761393ee4dc3ff8f4af487bd58f4307c9329bbedea02cac0089ad9c411e153"3306checksum = "1c789ec87f4687d022a2405cf46e0cd6284889f1839de292cadeb6c6019506f2"
3315dependencies = [3307dependencies = [
3316 "dashmap",3308 "dashmap",
3317 "futures",3309 "futures",
@@ -3323,11 +3315,10 @@ dependencies = [ · 5 unmodified lines
3323 3315
3324[[package]]3316[[package]]
3325name = "serial_test_derive"3317name = "serial_test_derive"
3326version = "0.9.0"3318version = "0.10.0"
3327source = "registry+https://github.com/rust-lang/crates.io-index"3319source = "registry+https://github.com/rust-lang/crates.io-index"
3328checksum = "4b6f5d1c3087fb119617cff2966fe3808a80e5eb59a8c1601d5994d66f4346a5"3320checksum = "b64f9e531ce97c88b4778aad0ceee079216071cffec6ac9b904277f8f92e7fe3"
3329dependencies = [3321dependencies = [
3330 "proc-macro-error",
3331 "proc-macro2",3322 "proc-macro2",
3332 "quote",3323 "quote",
3333 "syn",3324 "syn",
@@ -3473,9 +3464,9 @@ dependencies = [ · 139 unmodified lines
3473 3464
3474[[package]]3465[[package]]
3475name = "tabled"3466name = "tabled"
3476version = "0.8.0"3467version = "0.10.0"
3477source = "registry+https://github.com/rust-lang/crates.io-index"3468source = "registry+https://github.com/rust-lang/crates.io-index"
3478checksum = "e5b2f8c37d26d87d2252187b0a45ea3cbf42baca10377c7e7eaaa2800fa9bf97"3469checksum = "56c3ee73732ffceaea7b8f6b719ce3bb17f253fa27461ffeaf568ebd0cdb4b85"
3479dependencies = [3470dependencies = [
3480 "papergrid",3471 "papergrid",
3481 "unicode-width",3472 "unicode-width",
@@ -3596,9 +3587,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" · 114 unmodified lines
3596 3587
3597[[package]]3588[[package]]
3598name = "tokio"3589name = "tokio"
3599version = "1.23.0"3590version = "1.24.1"
3600source = "registry+https://github.com/rust-lang/crates.io-index"3591source = "registry+https://github.com/rust-lang/crates.io-index"
3601checksum = "eab6d665857cc6ca78d6e80303a02cea7a7851e85dfbd77cbdc09bd129f1ef46"3592checksum = "1d9f76183f91ecfb55e1d7d5602bd1d979e38a3a522fe900241cf195624d67ae"
3602dependencies = [3593dependencies = [
3603 "autocfg",3594 "autocfg",
3604 "bytes",3595 "bytes",
@@ -3608,7 +3599,7 @@ dependencies = [ · 3 unmodified lines
3608 "num_cpus",3599 "num_cpus",
3609 "pin-project-lite",3600 "pin-project-lite",
3610 "socket2",3601 "socket2",
3611 "windows-sys 0.42.0",3602 "windows-sys",
3612]3603]
3613 3604
3614[[package]]3605[[package]]
@@ -3655,15 +3646,22 @@ dependencies = [ · 40 unmodified lines
3655 "serde",3646 "serde",
3656]3647]
3657 3648
3649[[package]]
3650name = "toml_datetime"
3651version = "0.5.0"
3652source = "registry+https://github.com/rust-lang/crates.io-index"
3653checksum = "808b51e57d0ef8f71115d8f3a01e7d3750d01c79cac4b3eda910f4389fdf92fd"
3654
3658[[package]]3655[[package]]
3659name = "toml_edit"3656name = "toml_edit"
3660version = "0.14.4"3657version = "0.17.1"
3661source = "registry+https://github.com/rust-lang/crates.io-index"3658source = "registry+https://github.com/rust-lang/crates.io-index"
3662checksum = "5376256e44f2443f8896ac012507c19a012df0fe8758b55246ae51a2279db51f"3659checksum = "a34cc558345efd7e88b9eda9626df2138b80bb46a7606f695e751c892bc7dac6"
3663dependencies = [3660dependencies = [
3664 "combine",
3665 "indexmap",3661 "indexmap",
3666 "itertools",3662 "itertools",
3663 "nom8",
3664 "toml_datetime",
3667]3665]
3668 3666
3669[[package]]3667[[package]]
@@ -3751,9 +3749,9 @@ dependencies = [ · 81 unmodified lines
3751 3749
3752[[package]]3750[[package]]
3753name = "try-lock"3751name = "try-lock"
3754version = "0.2.3"3752version = "0.2.4"
3755source = "registry+https://github.com/rust-lang/crates.io-index"3753source = "registry+https://github.com/rust-lang/crates.io-index"
3756checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642"3754checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed"
3757 3755
3758[[package]]3756[[package]]
3759name = "tui"3757name = "tui"
@@ -4071,30 +4069,17 @@ dependencies = [ · 311 unmodified lines
4071 4069
4072[[package]]4070[[package]]
4073name = "windows"4071name = "windows"
4074version = "0.40.0"4072version = "0.43.0"
4075source = "registry+https://github.com/rust-lang/crates.io-index"4073source = "registry+https://github.com/rust-lang/crates.io-index"
4076checksum = "e30acc718a52fb130fec72b1cb5f55ffeeec9253e1b785e94db222178a6acaa1"4074checksum = "04662ed0e3e5630dfa9b26e4cb823b817f1a9addda855d973a9458c236556244"
4077dependencies = [4075dependencies = [
4078 "windows_aarch64_gnullvm 0.40.0",4076 "windows_aarch64_gnullvm",
4079 "windows_aarch64_msvc 0.40.0",4077 "windows_aarch64_msvc 0.42.0",
4080 "windows_i686_gnu 0.40.0",4078 "windows_i686_gnu 0.42.0",
4081 "windows_i686_msvc 0.40.0",4079 "windows_i686_msvc 0.42.0",
4082 "windows_x86_64_gnu 0.40.0",4080 "windows_x86_64_gnu 0.42.0",
4083 "windows_x86_64_gnullvm 0.40.0",4081 "windows_x86_64_gnullvm",
4084 "windows_x86_64_msvc 0.40.0",4082 "windows_x86_64_msvc 0.42.0",
4085]
4086
4087[[package]]
4088name = "windows-sys"
4089version = "0.36.1"
4090source = "registry+https://github.com/rust-lang/crates.io-index"
4091checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2"
4092dependencies = [
4093 "windows_aarch64_msvc 0.36.1",
4094 "windows_i686_gnu 0.36.1",
4095 "windows_i686_msvc 0.36.1",
4096 "windows_x86_64_gnu 0.36.1",
4097 "windows_x86_64_msvc 0.36.1",
4098]4083]
4099 4084
4100[[package]]4085[[package]]
@@ -4103,21 +4088,15 @@ version = "0.42.0" · 2 unmodified lines
4103source = "registry+https://github.com/rust-lang/crates.io-index"4088source = "registry+https://github.com/rust-lang/crates.io-index"
4104checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"4089checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"
4105dependencies = [4090dependencies = [
4106 "windows_aarch64_gnullvm 0.42.0",4091 "windows_aarch64_gnullvm",
4107 "windows_aarch64_msvc 0.42.0",4092 "windows_aarch64_msvc 0.42.0",
4108 "windows_i686_gnu 0.42.0",4093 "windows_i686_gnu 0.42.0",
4109 "windows_i686_msvc 0.42.0",4094 "windows_i686_msvc 0.42.0",
4110 "windows_x86_64_gnu 0.42.0",4095 "windows_x86_64_gnu 0.42.0",
4111 "windows_x86_64_gnullvm 0.42.0",4096 "windows_x86_64_gnullvm",
4112 "windows_x86_64_msvc 0.42.0",4097 "windows_x86_64_msvc 0.42.0",
4113]4098]
4114 4099
4115[[package]]
4116name = "windows_aarch64_gnullvm"
4117version = "0.40.0"
4118source = "registry+https://github.com/rust-lang/crates.io-index"
4119checksum = "f3caa4a1a16561b714323ca6b0817403738583033a6a92e04c5d10d4ba37ca10"
4120
4121[[package]]4100[[package]]
4122name = "windows_aarch64_gnullvm"4101name = "windows_aarch64_gnullvm"
4123version = "0.42.0"4102version = "0.42.0"
@@ -4130,18 +4109,6 @@ version = "0.29.0" · 6 unmodified lines
4130source = "registry+https://github.com/rust-lang/crates.io-index"4109source = "registry+https://github.com/rust-lang/crates.io-index"
4131checksum = "c3d027175d00b01e0cbeb97d6ab6ebe03b12330a35786cbaca5252b1c4bf5d9b"4110checksum = "c3d027175d00b01e0cbeb97d6ab6ebe03b12330a35786cbaca5252b1c4bf5d9b"
4132 4111
4133[[package]]
4134name = "windows_aarch64_msvc"
4135version = "0.36.1"
4136source = "registry+https://github.com/rust-lang/crates.io-index"
4137checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47"
4138
4139[[package]]
4140name = "windows_aarch64_msvc"
4141version = "0.40.0"
4142source = "registry+https://github.com/rust-lang/crates.io-index"
4143checksum = "328973c62dfcc50fb1aaa8e7100676e0b642fe56bac6bafff3327902db843ab4"
4144
4145[[package]]4112[[package]]
4146name = "windows_aarch64_msvc"4113name = "windows_aarch64_msvc"
4147version = "0.42.0"4114version = "0.42.0"
@@ -4154,18 +4121,6 @@ version = "0.29.0" · 6 unmodified lines
4154source = "registry+https://github.com/rust-lang/crates.io-index"4121source = "registry+https://github.com/rust-lang/crates.io-index"
4155checksum = "8793f59f7b8e8b01eda1a652b2697d87b93097198ae85f823b969ca5b89bba58"4122checksum = "8793f59f7b8e8b01eda1a652b2697d87b93097198ae85f823b969ca5b89bba58"
4156 4123
4157[[package]]
4158name = "windows_i686_gnu"
4159version = "0.36.1"
4160source = "registry+https://github.com/rust-lang/crates.io-index"
4161checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6"
4162
4163[[package]]
4164name = "windows_i686_gnu"
4165version = "0.40.0"
4166source = "registry+https://github.com/rust-lang/crates.io-index"
4167checksum = "aa5b09fad70f0df85dea2ac2a525537e415e2bf63ee31cf9b8e263645ee9f3c1"
4168
4169[[package]]4124[[package]]
4170name = "windows_i686_gnu"4125name = "windows_i686_gnu"
4171version = "0.42.0"4126version = "0.42.0"
@@ -4178,18 +4133,6 @@ version = "0.29.0" · 6 unmodified lines
4178source = "registry+https://github.com/rust-lang/crates.io-index"4133source = "registry+https://github.com/rust-lang/crates.io-index"
4179checksum = "8602f6c418b67024be2996c512f5f995de3ba417f4c75af68401ab8756796ae4"4134checksum = "8602f6c418b67024be2996c512f5f995de3ba417f4c75af68401ab8756796ae4"
4180 4135
4181[[package]]
4182name = "windows_i686_msvc"
4183version = "0.36.1"
4184source = "registry+https://github.com/rust-lang/crates.io-index"
4185checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024"
4186
4187[[package]]
4188name = "windows_i686_msvc"
4189version = "0.40.0"
4190source = "registry+https://github.com/rust-lang/crates.io-index"
4191checksum = "2a1ad4031c1a98491fa195d8d43d7489cb749f135f2e5c4eed58da094bd0d876"
4192
4193[[package]]4136[[package]]
4194name = "windows_i686_msvc"4137name = "windows_i686_msvc"
4195version = "0.42.0"4138version = "0.42.0"
@@ -4202,30 +4145,12 @@ version = "0.29.0" · 6 unmodified lines
4202source = "registry+https://github.com/rust-lang/crates.io-index"4145source = "registry+https://github.com/rust-lang/crates.io-index"
4203checksum = "f3d615f419543e0bd7d2b3323af0d86ff19cbc4f816e6453f36a2c2ce889c354"4146checksum = "f3d615f419543e0bd7d2b3323af0d86ff19cbc4f816e6453f36a2c2ce889c354"
4204 4147
4205[[package]]
4206name = "windows_x86_64_gnu"
4207version = "0.36.1"
4208source = "registry+https://github.com/rust-lang/crates.io-index"
4209checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1"
4210
4211[[package]]
4212name = "windows_x86_64_gnu"
4213version = "0.40.0"
4214source = "registry+https://github.com/rust-lang/crates.io-index"
4215checksum = "520ff37edd72da8064b49d2281182898e17f0688ae9f4070bca27e4b5c162ac7"
4216
4217[[package]]4148[[package]]
4218name = "windows_x86_64_gnu"4149name = "windows_x86_64_gnu"
4219version = "0.42.0"4150version = "0.42.0"
4220source = "registry+https://github.com/rust-lang/crates.io-index"4151source = "registry+https://github.com/rust-lang/crates.io-index"
4221checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed"4152checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed"
4222 4153
4223[[package]]
4224name = "windows_x86_64_gnullvm"
4225version = "0.40.0"
4226source = "registry+https://github.com/rust-lang/crates.io-index"
4227checksum = "046e5b82215102c44fd75f488f1b9158973d02aa34d06ed85c23d6f5520a2853"
4228
4229[[package]]4154[[package]]
4230name = "windows_x86_64_gnullvm"4155name = "windows_x86_64_gnullvm"
4231version = "0.42.0"4156version = "0.42.0"
@@ -4238,18 +4163,6 @@ version = "0.29.0" · 6 unmodified lines
4238source = "registry+https://github.com/rust-lang/crates.io-index"4163source = "registry+https://github.com/rust-lang/crates.io-index"
4239checksum = "11d95421d9ed3672c280884da53201a5c46b7b2765ca6faf34b0d71cf34a3561"4164checksum = "11d95421d9ed3672c280884da53201a5c46b7b2765ca6faf34b0d71cf34a3561"
4240 4165
4241[[package]]
4242name = "windows_x86_64_msvc"
4243version = "0.36.1"
4244source = "registry+https://github.com/rust-lang/crates.io-index"
4245checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680"
4246
4247[[package]]
4248name = "windows_x86_64_msvc"
4249version = "0.40.0"
4250source = "registry+https://github.com/rust-lang/crates.io-index"
4251checksum = "2a0c9c6df55dd1bfa76e131cef44bdd8ec9c819ef3611f04dfe453fd5bfeda28"
4252
4253[[package]]4166[[package]]
4254name = "windows_x86_64_msvc"4167name = "windows_x86_64_msvc"
4255version = "0.42.0"4168version = "0.42.0"
Cargo.toml+1−1
@@ -97,7 +97,7 @@ futures-lite = { version = "1.12.0", optional = true, default-features = false, · 96 unmodified lines
97 97
98# for progress98# for progress
99owo-colors = "3.5.0"99owo-colors = "3.5.0"
100tabled = { version = "0.8.0", default-features = false }100tabled = { version = "0.10.0", default-features = false }
101 101
102document-features = { version = "0.2.0", optional = true }102document-features = { version = "0.2.0", optional = true }
103 103
cargo-smart-release/Cargo.toml+3−3
@@ -27,13 +27,13 @@ cache-efficiency-debug = ["git-repository/cache-efficiency-debug"] · 26 unmodified lines
27git-repository = { version = "^0.32.0", path = "../git-repository", default-features = false, features = ["max-performance-safe"] }27git-repository = { version = "^0.32.0", path = "../git-repository", default-features = false, features = ["max-performance-safe"] }
28anyhow = "1.0.42"28anyhow = "1.0.42"
29clap = { version = "3.2.5", features = ["derive", "cargo"] }29clap = { version = "3.2.5", features = ["derive", "cargo"] }
30env_logger = { version = "0.9.0", default-features = false, features = ["humantime", "termcolor", "atty"] }30env_logger = { version = "0.10.0", default-features = false, features = ["humantime", "auto-color"] }
31cargo_metadata = "0.15.0"31cargo_metadata = "0.15.0"
32log = "0.4.14"32log = "0.4.14"
33toml_edit = "0.14.0"33toml_edit = "0.17.1"
34semver = "1.0.4"34semver = "1.0.4"
35crates-index = "0.18.9"35crates-index = "0.18.9"
36cargo_toml = "0.11.4"36cargo_toml = "0.14.0"
37nom = { version = "7", default-features = false, features = ["std"]}37nom = { version = "7", default-features = false, features = ["std"]}
38git-conventional = "0.12.0"38git-conventional = "0.12.0"
39time = "0.3.2"39time = "0.3.2"
cargo-smart-release/src/changelog/section/from_history.rs+2−1
@@ -133,7 +133,8 @@ impl Section { · 132 unmodified lines
133 133
134 let version = crate::git::try_strip_tag_path(segment.head.name.as_ref())134 let version = crate::git::try_strip_tag_path(segment.head.name.as_ref())
135 .map(|tag_name| {135 .map(|tag_name| {
136 let package_name = (!is_top_level_package(&package.manifest_path, repo)).then(|| package.name.as_str());136 let package_name =
137 (!is_top_level_package(&package.manifest_path, repo)).then_some(package.name.as_str());
137 changelog::Version::Semantic(138 changelog::Version::Semantic(
138 utils::parse_possibly_prefixed_tag_version(package_name, tag_name)139 utils::parse_possibly_prefixed_tag_version(package_name, tag_name)
139 .expect("here we always have a valid version as it passed a filter when creating it"),140 .expect("here we always have a valid version as it passed a filter when creating it"),
cargo-smart-release/src/command/changelog.rs+7−5
@@ -20,7 +20,7 @@ pub fn changelog(opts: Options, crates: Vec<String>) -> anyhow::Result<()> { · 19 unmodified lines
20 no_links,20 no_links,
21 ..21 ..
22 } = opts;22 } = opts;
23 let bump_spec = dependencies.then(|| BumpSpec::Auto).unwrap_or(BumpSpec::Keep);23 let bump_spec = if dependencies { BumpSpec::Auto } else { BumpSpec::Keep };
24 let force_history_segmentation = false;24 let force_history_segmentation = false;
25 let ctx = crate::Context::new(crates.clone(), force_history_segmentation, bump_spec, bump_spec)?;25 let ctx = crate::Context::new(crates.clone(), force_history_segmentation, bump_spec, bump_spec)?;
26 let crates: Vec<_> = {26 let crates: Vec<_> = {
@@ -41,9 +41,11 @@ pub fn changelog(opts: Options, crates: Vec<String>) -> anyhow::Result<()> { · 14 unmodified lines
41 log::info!(41 log::info!(
42 "Skipping '{}' as it won't be published.{}",42 "Skipping '{}' as it won't be published.{}",
43 d.package.name,43 d.package.name,
44 (!dependencies)44 if !dependencies {
45 .then(|| " Try not to specify --no-dependencies/--only.")45 " Try not to specify --no-dependencies/--only."
46 .unwrap_or("")46 } else {
47 ""
48 }
47 );49 );
48 }50 }
49 None51 None
@@ -114,7 +116,7 @@ pub fn changelog(opts: Options, crates: Vec<String>) -> anyhow::Result<()> { · 64 unmodified lines
114 if num_crates == 0 {116 if num_crates == 0 {
115 anyhow::bail!(117 anyhow::bail!(
116 "The given crate{} {} didn't change and no changelog could be generated.",118 "The given crate{} {} didn't change and no changelog could be generated.",
117 (ctx.crate_names.len() != 1).then(|| "s").unwrap_or(""),119 if ctx.crate_names.len() != 1 { "s" } else { "" },
118 ctx.crate_names120 ctx.crate_names
119 .iter()121 .iter()
120 .map(|c| format!("'{}'", c))122 .map(|c| format!("'{}'", c))
cargo-smart-release/src/command/release/manifest.rs+1−1
@@ -263,7 +263,7 @@ fn preview_changelogs( · 262 unmodified lines
263 "use --no-changelog-preview to disable or Ctrl-C to abort, or the 'changelog' subcommand.";263 "use --no-changelog-preview to disable or Ctrl-C to abort, or the 'changelog' subcommand.";
264 let changelogs_with_changes = pending_changelogs264 let changelogs_with_changes = pending_changelogs
265 .iter()265 .iter()
266 .filter_map(|(_, has_changes, lock)| (*has_changes).then(|| lock))266 .filter_map(|(_, has_changes, lock)| (*has_changes).then_some(lock))
267 .collect::<Vec<_>>();267 .collect::<Vec<_>>();
268 log::info!(268 log::info!(
269 "About to preview {} pending changelog(s), {}",269 "About to preview {} pending changelog(s), {}",
cargo-smart-release/src/command/release/mod.rs+6−6
@@ -117,7 +117,7 @@ fn assure_crates_index_is_uptodate<'meta>( · 116 unmodified lines
117 .find_map(|(d, b)| {117 .find_map(|(d, b)| {
118 b.latest_release118 b.latest_release
119 .as_ref()119 .as_ref()
120 .and_then(|lr| (lr >= &b.next_release).then(|| d))120 .and_then(|lr| (lr >= &b.next_release).then_some(d))
121 })121 })
122 {122 {
123 let mut index = crate::crates_index::Index::new_cargo_default()?;123 let mut index = crate::crates_index::Index::new_cargo_default()?;
@@ -172,7 +172,7 @@ fn present_and_validate_dependencies( · 48 unmodified lines
172 172
173 let skipped = all_skipped173 let skipped = all_skipped
174 .iter()174 .iter()
175 .filter_map(|(name, has_adjustment, reason)| (!has_adjustment).then(|| (*name, reason)))175 .filter_map(|(name, has_adjustment, reason)| (!has_adjustment).then_some((*name, reason)))
176 .collect::<Vec<_>>();176 .collect::<Vec<_>>();
177 if !skipped.is_empty() {177 if !skipped.is_empty() {
178 let skipped_len = skipped.len();178 let skipped_len = skipped.len();
@@ -189,7 +189,7 @@ fn present_and_validate_dependencies( · 10 unmodified lines
189 log::info!(189 log::info!(
190 "Will not publish or alter {} dependent crate{}: {}",190 "Will not publish or alter {} dependent crate{}: {}",
191 skipped_len,191 skipped_len,
192 (skipped_len != 1).then(|| "s").unwrap_or(""),192 if skipped_len != 1 { "s" } else { "" },
193 crates_by_reason193 crates_by_reason
194 .into_iter()194 .into_iter()
195 .map(|(key, names)| format!(195 .map(|(key, names)| format!(
@@ -225,7 +225,7 @@ fn present_and_validate_dependencies( · 29 unmodified lines
225 if let Some(latest_release) = bump225 if let Some(latest_release) = bump
226 .latest_release226 .latest_release
227 .as_ref()227 .as_ref()
228 .and_then(|lr| (*lr >= bump.next_release).then(|| lr))228 .and_then(|lr| (*lr >= bump.next_release).then_some(lr))
229 {229 {
230 let bump_flag = match dep.kind {230 let bump_flag = match dep.kind {
231 dependency::Kind::UserSelection => "--bump <level>",231 dependency::Kind::UserSelection => "--bump <level>",
@@ -329,7 +329,7 @@ fn present_and_validate_dependencies( · 97 unmodified lines
329 },329 },
330 );330 );
331 for (cause, deps_and_bumps) in affected_crates_by_cause {331 for (cause, deps_and_bumps) in affected_crates_by_cause {
332 let plural_s = (deps_and_bumps.len() != 1).then(|| "s").unwrap_or("");332 let plural_s = if deps_and_bumps.len() != 1 { "s" } else { "" };
333 log::info!(333 log::info!(
334 "{} adjust {} manifest version{} due to breaking change in '{}': {}",334 "{} adjust {} manifest version{} due to breaking change in '{}': {}",
335 will(dry_run),335 will(dry_run),
@@ -361,7 +361,7 @@ fn present_and_validate_dependencies( · 25 unmodified lines
361 .collect::<Vec<_>>();361 .collect::<Vec<_>>();
362 if !crate_names_for_manifest_updates.is_empty() {362 if !crate_names_for_manifest_updates.is_empty() {
363 let plural_s = (crate_names_for_manifest_updates.len() > 1)363 let plural_s = (crate_names_for_manifest_updates.len() > 1)
364 .then(|| "s")364 .then_some("s")
365 .unwrap_or_default();365 .unwrap_or_default();
366 log::info!(366 log::info!(
367 "{} adjust version constraints in manifest{} of {} package{} as direct dependencies are changing: {}",367 "{} adjust version constraints in manifest{} of {} package{} as direct dependencies are changing: {}",
cargo-smart-release/src/commit/message.rs+1−1
@@ -22,7 +22,7 @@ mod additions { · 21 unmodified lines
22 .and_then(|p| {22 .and_then(|p| {
23 part_to_left23 part_to_left
24 .is_char_boundary(p + 1)24 .is_char_boundary(p + 1)
25 .then(|| p + 1)25 .then_some(p + 1)
26 .or_else(|| part_to_left[p..].chars().next().map(|c| p + c.len_utf8()))26 .or_else(|| part_to_left[p..].chars().next().map(|c| p + c.len_utf8()))
27 })27 })
28 .unwrap_or(start);28 .unwrap_or(start);
cargo-smart-release/src/git/mod.rs+2−2
@@ -40,7 +40,7 @@ pub fn change_since_last_release(package: &Package, ctx: &crate::Context) -> any · 39 unmodified lines
40 // KEEP THIS IN SYNC with git::create_ref_history()!40 // KEEP THIS IN SYNC with git::create_ref_history()!
41 .or_else(|| (ctx.meta.workspace_members.len() != 1).then(|| Utf8Path::new("src")))41 .or_else(|| (ctx.meta.workspace_members.len() != 1).then(|| Utf8Path::new("src")))
42 {42 {
43 None => (current_commit != released_target).then(|| PackageChangeKind::ChangedOrNew),43 None => (current_commit != released_target).then_some(PackageChangeKind::ChangedOrNew),
44 Some(dir) => {44 Some(dir) => {
45 let components = dir.components().map(component_to_bytes);45 let components = dir.components().map(component_to_bytes);
46 let current_dir_id = current_commit46 let current_dir_id = current_commit
@@ -58,7 +58,7 @@ pub fn change_since_last_release(package: &Package, ctx: &crate::Context) -> any · 11 unmodified lines
58 .expect("path must exist as it was supposedly released there")58 .expect("path must exist as it was supposedly released there")
59 .object_id();59 .object_id();
60 60
61 (released_dir_id != current_dir_id).then(|| PackageChangeKind::ChangedOrNew)61 (released_dir_id != current_dir_id).then_some(PackageChangeKind::ChangedOrNew)
62 }62 }
63 }63 }
64 }64 }
cargo-smart-release/src/traverse.rs+10−8
@@ -297,11 +297,11 @@ fn forward_propagate_breaking_changes_for_manifest_updates<'meta>( · 296 unmodified lines
297 );297 );
298 }298 }
299 } else if is_pre_release_version(&dependant.version) || allow_auto_publish_of_stable_crates {299 } else if is_pre_release_version(&dependant.version) || allow_auto_publish_of_stable_crates {
300 let kind = ctx300 let kind = if ctx.crate_names.contains(&dependant.name) {
301 .crate_names301 dependency::Kind::UserSelection
302 .contains(&dependant.name)302 } else {
303 .then(|| dependency::Kind::UserSelection)303 dependency::Kind::DependencyOrDependentOfUserSelection
304 .unwrap_or(dependency::Kind::DependencyOrDependentOfUserSelection);304 };
305 let adjustment = dependency::VersionAdjustment::Breakage {305 let adjustment = dependency::VersionAdjustment::Breakage {
306 bump,306 bump,
307 change: None,307 change: None,
@@ -448,9 +448,11 @@ impl EditForPublish { · 140 unmodified lines
448}448}
449 449
450fn breaking_version_bump(ctx: &Context, package: &Package, bump_when_needed: bool) -> anyhow::Result<Bump> {450fn breaking_version_bump(ctx: &Context, package: &Package, bump_when_needed: bool) -> anyhow::Result<Bump> {
451 let breaking_spec = is_pre_release_version(&package.version)451 let breaking_spec = if is_pre_release_version(&package.version) {
452 .then(|| BumpSpec::Minor)452 BumpSpec::Minor
453 .unwrap_or(BumpSpec::Major);453 } else {
454 BumpSpec::Major
455 };
454 version::bump_package_with_spec(package, breaking_spec, ctx, bump_when_needed)456 version::bump_package_with_spec(package, breaking_spec, ctx, bump_when_needed)
455}457}
456 458
clippy.toml+1−1
@@ -1 +1 @@
1msrv = "1.60.0"1msrv = "1.64.0"
etc/msrv-badge.svg+1−1
@@ -1 +1 @@
1<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="92" height="20" role="img" aria-label="rustc: 1.59.0+"><title>rustc: 1.59.0+</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="92" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="37" height="20" fill="#555"/><rect x="37" width="55" height="20" fill="#007ec6"/><rect width="92" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="195" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="270">rustc</text><text x="195" y="140" transform="scale(.1)" fill="#fff" textLength="270">rustc</text><text aria-hidden="true" x="635" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="450">1.60.0+</text><text x="635" y="140" transform="scale(.1)" fill="#fff" textLength="450">1.60.0+</text></g></svg>1<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="92" height="20" role="img" aria-label="rustc: 1.59.0+"><title>rustc: 1.59.0+</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="92" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="37" height="20" fill="#555"/><rect x="37" width="55" height="20" fill="#007ec6"/><rect width="92" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="195" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="270">rustc</text><text x="195" y="140" transform="scale(.1)" fill="#fff" textLength="270">rustc</text><text aria-hidden="true" x="635" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="450">1.60.0+</text><text x="635" y="140" transform="scale(.1)" fill="#fff" textLength="450">1.64.0+</text></g></svg>
git-attributes/src/match_group.rs+4−4
@@ -78,7 +78,7 @@ impl Pattern for Attributes { · 77 unmodified lines
78 Value::MacroAttributes(into_owned_assignments(assignments).ok()?),78 Value::MacroAttributes(into_owned_assignments(assignments).ok()?),
79 ),79 ),
80 crate::parse::Kind::Pattern(p) => (80 crate::parse::Kind::Pattern(p) => (
81 (!p.is_negative()).then(|| p)?,81 (!p.is_negative()).then_some(p)?,
82 Value::Assignments(into_owned_assignments(assignments).ok()?),82 Value::Assignments(into_owned_assignments(assignments).ok()?),
83 ),83 ),
84 };84 };
@@ -278,7 +278,7 @@ where · 193 unmodified lines
278 }| {278 }| {
279 pattern279 pattern
280 .matches_repo_relative_path(relative_path, basename_start_pos, is_dir, case)280 .matches_repo_relative_path(relative_path, basename_start_pos, is_dir, case)
281 .then(|| Match {281 .then_some(Match {
282 pattern,282 pattern,
283 value,283 value,
284 source: self.source.as_deref(),284 source: self.source.as_deref(),
@@ -307,7 +307,7 @@ where · 22 unmodified lines
307 .find_map(|(idx, pm)| {307 .find_map(|(idx, pm)| {
308 pm.pattern308 pm.pattern
309 .matches_repo_relative_path(relative_path, basename_start_pos, is_dir, case)309 .matches_repo_relative_path(relative_path, basename_start_pos, is_dir, case)
310 .then(|| idx)310 .then_some(idx)
311 })311 })
312 }312 }
313 313
@@ -321,7 +321,7 @@ where · 7 unmodified lines
321 relative_path.strip_prefix(base.as_slice())?.as_bstr(),321 relative_path.strip_prefix(base.as_slice())?.as_bstr(),
322 basename_pos.and_then(|pos| {322 basename_pos.and_then(|pos| {
323 let pos = pos - base.len();323 let pos = pos - base.len();
324 (pos != 0).then(|| pos)324 (pos != 0).then_some(pos)
325 }),325 }),
326 ),326 ),
327 None => (relative_path, basename_pos),327 None => (relative_path, basename_pos),
git-config/Cargo.toml+1−1
@@ -36,7 +36,7 @@ document-features = { version = "0.2.0", optional = true } · 35 unmodified lines
36[dev-dependencies]36[dev-dependencies]
37git-testtools = { path = "../tests/tools"}37git-testtools = { path = "../tests/tools"}
38git-repository = { path = "../git-repository" }38git-repository = { path = "../git-repository" }
39serial_test = "0.9.0"39serial_test = "0.10.0"
40serde_derive = "1.0"40serde_derive = "1.0"
41criterion = "0.4.0"41criterion = "0.4.0"
42tempfile = "3.2.0"42tempfile = "3.2.0"
git-config/src/file/access/mutate.rs+1−0
@@ -348,6 +348,7 @@ impl<'event> File<'event> { · 347 unmodified lines
348 }348 }
349 lhs.extend(rhs);349 lhs.extend(rhs);
350 }350 }
351 #[allow(clippy::unnecessary_lazy_evaluations)]
351 let our_last_section_before_append =352 let our_last_section_before_append =
352 insert_after.or_else(|| (self.section_id_counter != 0).then(|| SectionId(self.section_id_counter - 1)));353 insert_after.or_else(|| (self.section_id_counter != 0).then(|| SectionId(self.section_id_counter - 1)));
353 354
git-config/src/file/access/read_only.rs+2−2
@@ -166,7 +166,7 @@ impl<'event> File<'event> { · 165 unmodified lines
166 let sections = &self.sections;166 let sections = &self.sections;
167 move |id| {167 move |id| {
168 let s = &sections[&id];168 let s = &sections[&id];
169 filter(s.meta()).then(|| s)169 filter(s.meta()).then_some(s)
170 }170 }
171 }))171 }))
172 }172 }
@@ -258,7 +258,7 @@ impl<'event> File<'event> { · 85 unmodified lines
258 .sections258 .sections
259 .get(&id)259 .get(&id)
260 .expect("section doesn't have id from from lookup");260 .expect("section doesn't have id from from lookup");
261 filter(s.meta()).then(|| s)261 filter(s.meta()).then_some(s)
262 })262 })
263 })263 })
264 }264 }
git-config/src/file/includes/mod.rs+1−1
@@ -189,7 +189,7 @@ fn onbranch_matches( · 188 unmodified lines
189 branch_name,189 branch_name,
190 git_glob::wildmatch::Mode::NO_MATCH_SLASH_LITERAL,190 git_glob::wildmatch::Mode::NO_MATCH_SLASH_LITERAL,
191 )191 )
192 .then(|| ())192 .then_some(())
193}193}
194 194
195fn gitdir_matches(195fn gitdir_matches(
git-config/src/file/init/comfort.rs+1−1
@@ -31,7 +31,7 @@ impl File<'static> { · 30 unmodified lines
31 .filter_map(|source| {31 .filter_map(|source| {
32 let path = source32 let path = source
33 .storage_location(&mut |name| std::env::var_os(name))33 .storage_location(&mut |name| std::env::var_os(name))
34 .and_then(|p| p.is_file().then(|| p))34 .and_then(|p| p.is_file().then_some(p))
35 .map(|p| p.into_owned());35 .map(|p| p.into_owned());
36 36
37 Metadata {37 Metadata {
git-config/src/file/mutable/section.rs+1−1
@@ -71,7 +71,7 @@ impl<'a, 'event> SectionMut<'a, 'event> { · 70 unmodified lines
71 if !bytes.peek().map_or(true, |b| b.is_ascii_whitespace()) {71 if !bytes.peek().map_or(true, |b| b.is_ascii_whitespace()) {
72 c.insert(0, b' ');72 c.insert(0, b' ');
73 }73 }
74 c.extend(bytes.map(|b| (*b == b'\n').then(|| b' ').unwrap_or(*b)));74 c.extend(bytes.map(|b| if *b == b'\n' { b' ' } else { *b }));
75 c.into()75 c.into()
76 }),76 }),
77 }));77 }));
git-config/src/file/section/body.rs+1−1
@@ -153,7 +153,7 @@ impl<'event> Body<'event> { · 152 unmodified lines
153 // is included in the range153 // is included in the range
154 let value_range = value_range.start..value_range.end + 1;154 let value_range = value_range.start..value_range.end + 1;
155 let key_range = key_start..value_range.end;155 let key_range = key_start..value_range.end;
156 (key_range, (value_range.start != key_start + 1).then(|| value_range))156 (key_range, (value_range.start != key_start + 1).then_some(value_range))
157 })157 })
158 }158 }
159}159}
git-config/src/file/util.rs+1−1
@@ -61,7 +61,7 @@ impl<'event> File<'event> { · 60 unmodified lines
61 section_order61 section_order
62 .iter()62 .iter()
63 .enumerate()63 .enumerate()
64 .find_map(|(idx, id)| (*id == section_id).then(|| idx))64 .find_map(|(idx, id)| (*id == section_id).then_some(idx))
65 .expect("before-section exists")65 .expect("before-section exists")
66 }66 }
67 };67 };
git-config/src/file/write.rs+1−1
@@ -63,7 +63,7 @@ pub(crate) fn ends_with_newline(e: &[crate::parse::Event<'_>], nl: impl AsRef<[u · 62 unmodified lines
63 e.iter()63 e.iter()
64 .rev()64 .rev()
65 .take_while(|e| e.to_bstr_lossy().iter().all(|b| b.is_ascii_whitespace()))65 .take_while(|e| e.to_bstr_lossy().iter().all(|b| b.is_ascii_whitespace()))
66 .find_map(|e| e.to_bstr_lossy().contains_str(nl.as_ref()).then(|| true))66 .find_map(|e| e.to_bstr_lossy().contains_str(nl.as_ref()).then_some(true))
67 .unwrap_or(false)67 .unwrap_or(false)
68}68}
69 69
git-config/src/parse/nom/mod.rs+1−1
@@ -400,7 +400,7 @@ fn value_impl<'a>(i: &'a [u8], dispatch: &mut impl FnMut(Event<'a>)) -> IResult< · 399 unmodified lines
400 .iter()400 .iter()
401 .enumerate()401 .enumerate()
402 .rev()402 .rev()
403 .find_map(|(idx, b)| (!b.is_ascii_whitespace()).then(|| idx + 1))403 .find_map(|(idx, b)| (!b.is_ascii_whitespace()).then_some(idx + 1))
404 .unwrap_or(0);404 .unwrap_or(0);
405 (405 (
406 &i[value_end_no_trailing_whitespace..],406 &i[value_end_no_trailing_whitespace..],
git-config/src/parse/section/header.rs+2−2
@@ -48,14 +48,14 @@ pub fn is_valid_subsection(name: &BStr) -> bool { · 47 unmodified lines
48 48
49fn validated_subsection(name: Cow<'_, BStr>) -> Result<Cow<'_, BStr>, Error> {49fn validated_subsection(name: Cow<'_, BStr>) -> Result<Cow<'_, BStr>, Error> {
50 is_valid_subsection(name.as_ref())50 is_valid_subsection(name.as_ref())
51 .then(|| name)51 .then_some(name)
52 .ok_or(Error::InvalidSubSection)52 .ok_or(Error::InvalidSubSection)
53}53}
54 54
55fn validated_name(name: Cow<'_, BStr>) -> Result<Cow<'_, BStr>, Error> {55fn validated_name(name: Cow<'_, BStr>) -> Result<Cow<'_, BStr>, Error> {
56 name.iter()56 name.iter()
57 .all(|b| b.is_ascii_alphanumeric() || *b == b'-')57 .all(|b| b.is_ascii_alphanumeric() || *b == b'-')
58 .then(|| name)58 .then_some(name)
59 .ok_or(Error::InvalidName)59 .ok_or(Error::InvalidName)
60}60}
61 61
git-config/tests/file/init/from_paths/includes/conditional/mod.rs+5−2
@@ -142,8 +142,11 @@ fn options_with_git_dir(git_dir: &Path) -> init::Options<'_> { · 141 unmodified lines
142fn git_init(path: impl AsRef<std::path::Path>, bare: bool) -> crate::Result<git::Repository> {142fn git_init(path: impl AsRef<std::path::Path>, bare: bool) -> crate::Result<git::Repository> {
143 Ok(git::ThreadSafeRepository::init_opts(143 Ok(git::ThreadSafeRepository::init_opts(
144 path,144 path,
145 bare.then(|| git::create::Kind::Bare)145 if bare {
146 .unwrap_or(git::create::Kind::WithWorktree),146 git::create::Kind::Bare
147 } else {
148 git::create::Kind::WithWorktree
149 },
147 git::create::Options::default(),150 git::create::Options::default(),
148 git::open::Options::isolated().config_overrides(["user.name=gitoxide", "user.email=gitoxide@localhost"]),151 git::open::Options::isolated().config_overrides(["user.name=gitoxide", "user.email=gitoxide@localhost"]),
149 )?152 )?
git-date/tests/time/baseline.rs+1−1
@@ -29,7 +29,7 @@ static BASELINE: Lazy<HashMap<String, Sample>> = Lazy::new(|| { · 28 unmodified lines
29 map.insert(29 map.insert(
30 date_str.into(),30 date_str.into(),
31 Sample {31 Sample {
32 format_name: (!format_name.is_empty()).then(|| format_name),32 format_name: (!format_name.is_empty()).then_some(format_name),
33 exit_code,33 exit_code,
34 time_in_seconds_since_unix_epoch,34 time_in_seconds_since_unix_epoch,
35 },35 },
git-discover/Cargo.toml+1−1
@@ -22,7 +22,7 @@ thiserror = "1.0.26" · 21 unmodified lines
22 22
23[dev-dependencies]23[dev-dependencies]
24git-testtools = { path = "../tests/tools" }24git-testtools = { path = "../tests/tools" }
25serial_test = "0.9.0"25serial_test = "0.10.0"
26is_ci = "1.1.1"26is_ci = "1.1.1"
27 27
28[target.'cfg(target_os = "macos")'.dev-dependencies]28[target.'cfg(target_os = "macos")'.dev-dependencies]
git-discover/src/upwards/mod.rs+1−1
@@ -60,7 +60,7 @@ pub(crate) mod function { · 59 unmodified lines
60 60
61 let filter_by_trust = |x: &Path| -> Result<Option<Trust>, Error> {61 let filter_by_trust = |x: &Path| -> Result<Option<Trust>, Error> {
62 let trust = Trust::from_path_ownership(x).map_err(|err| Error::CheckTrust { path: x.into(), err })?;62 let trust = Trust::from_path_ownership(x).map_err(|err| Error::CheckTrust { path: x.into(), err })?;
63 Ok((trust >= required_trust).then(|| (trust)))63 Ok((trust >= required_trust).then_some(trust))
64 };64 };
65 65
66 let max_height = if !ceiling_dirs.is_empty() {66 let max_height = if !ceiling_dirs.is_empty() {
git-features/src/lib.rs+1−1
@@ -58,7 +58,7 @@ pub mod iter { · 57 unmodified lines
58 break;58 break;
59 }59 }
60 }60 }
61 (!res.is_empty()).then(|| res)61 (!res.is_empty()).then_some(res)
62 }62 }
63 }63 }
64}64}
git-features/src/parallel/in_parallel.rs+1−1
@@ -165,7 +165,7 @@ where · 164 unmodified lines
165 let mut state = new_thread_state(thread_id);165 let mut state = new_thread_state(thread_id);
166 while let Ok(input_index) =166 while let Ok(input_index) =
167 index.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |x| {167 index.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |x| {
168 (x < input_len).then(|| x + 1)168 (x < input_len).then_some(x + 1)
169 })169 })
170 {170 {
171 if stop_everything.load(Ordering::Relaxed) {171 if stop_everything.load(Ordering::Relaxed) {
git-glob/src/wildmatch.rs+1−4
@@ -72,10 +72,7 @@ pub(crate) mod function { · 71 unmodified lines
72 }72 }
73 }73 }
74 STAR => {74 STAR => {
75 let mut match_slash = mode75 let mut match_slash = !mode.contains(Mode::NO_MATCH_SLASH_LITERAL);
76 .contains(Mode::NO_MATCH_SLASH_LITERAL)
77 .then(|| false)
78 .unwrap_or(true);
79 match p.next() {76 match p.next() {
80 Some((next_p_idx, next_p_ch)) => {77 Some((next_p_idx, next_p_ch)) => {
81 let next;78 let next;
git-index/src/extension/index_entry_offset_table.rs+1−1
@@ -38,6 +38,6 @@ pub fn decode(data: &[u8]) -> Option<Vec<Offset>> { · 37 unmodified lines
38 38
39pub fn find(extensions: &[u8], object_hash: git_hash::Kind) -> Option<Vec<Offset>> {39pub fn find(extensions: &[u8], object_hash: git_hash::Kind) -> Option<Vec<Offset>> {
40 extension::Iter::new_without_checksum(extensions, object_hash)?40 extension::Iter::new_without_checksum(extensions, object_hash)?
41 .find_map(|(sig, ext_data)| (sig == SIGNATURE).then(|| ext_data))41 .find_map(|(sig, ext_data)| (sig == SIGNATURE).then_some(ext_data))
42 .and_then(decode)42 .and_then(decode)
43}43}
git-index/src/extension/tree/verify.rs+1−1
@@ -119,7 +119,7 @@ impl Tree { · 118 unmodified lines
119 }119 }
120 120
121 let mut buf = Vec::new();121 let mut buf = Vec::new();
122 let declared_entries = verify_recursive(self.id, &self.children, use_find.then(|| &mut buf), &mut find)?;122 let declared_entries = verify_recursive(self.id, &self.children, use_find.then_some(&mut buf), &mut find)?;
123 if let Some((actual, num_entries)) = declared_entries.zip(self.num_entries) {123 if let Some((actual, num_entries)) = declared_entries.zip(self.num_entries) {
124 if actual > num_entries {124 if actual > num_entries {
125 return Err(Error::EntriesCount {125 return Err(Error::EntriesCount {
git-index/src/extension/untracked_cache.rs+3−3
@@ -58,14 +58,14 @@ pub fn decode(data: &[u8], object_hash: git_hash::Kind) -> Option<UntrackedCache · 57 unmodified lines
58 58
59 let mut res = UntrackedCache {59 let mut res = UntrackedCache {
60 identifier: identifier.into(),60 identifier: identifier.into(),
61 info_exclude: (!info_exclude.id.is_null()).then(|| info_exclude),61 info_exclude: (!info_exclude.id.is_null()).then_some(info_exclude),
62 excludes_file: (!excludes_file.id.is_null()).then(|| excludes_file),62 excludes_file: (!excludes_file.id.is_null()).then_some(excludes_file),
63 exclude_filename_per_dir: exclude_filename_per_dir.into(),63 exclude_filename_per_dir: exclude_filename_per_dir.into(),
64 dir_flags,64 dir_flags,
65 directories: Vec::new(),65 directories: Vec::new(),
66 };66 };
67 if num_directory_blocks == 0 {67 if num_directory_blocks == 0 {
68 return data.is_empty().then(|| res);68 return data.is_empty().then_some(res);
69 }69 }
70 70
71 let num_directory_blocks = num_directory_blocks.try_into().ok()?;71 let num_directory_blocks = num_directory_blocks.try_into().ok()?;
git-index/src/file/verify.rs+1−1
@@ -33,7 +33,7 @@ impl File { · 32 unmodified lines
33 &mut git_features::progress::Discard,33 &mut git_features::progress::Discard,
34 &should_interrupt,34 &should_interrupt,
35 )?;35 )?;
36 (actual == checksum).then(|| ()).ok_or(Error::ChecksumMismatch {36 (actual == checksum).then_some(()).ok_or(Error::ChecksumMismatch {
37 actual,37 actual,
38 expected: checksum,38 expected: checksum,
39 })39 })
git-index/src/write.rs+1−1
@@ -132,7 +132,7 @@ impl State { · 131 unmodified lines
132 fn detect_required_version(&self) -> Version {132 fn detect_required_version(&self) -> Version {
133 self.entries133 self.entries
134 .iter()134 .iter()
135 .find_map(|e| e.flags.contains(entry::Flags::EXTENDED).then(|| Version::V3))135 .find_map(|e| e.flags.contains(entry::Flags::EXTENDED).then_some(Version::V3))
136 .unwrap_or(Version::V2)136 .unwrap_or(Version::V2)
137 }137 }
138}138}
git-mailmap/src/parse.rs+1−1
@@ -110,7 +110,7 @@ fn parse_name_and_email( · 109 unmodified lines
110 }110 }
111 let name = line[..start_bracket].trim().as_bstr();111 let name = line[..start_bracket].trim().as_bstr();
112 let rest = line[start_bracket + closing_bracket + 2..].as_bstr();112 let rest = line[start_bracket + closing_bracket + 2..].as_bstr();
113 Ok(((!name.is_empty()).then(|| name), Some(email), rest))113 Ok(((!name.is_empty()).then_some(name), Some(email), rest))
114 }114 }
115 None => Ok((None, None, line)),115 None => Ok((None, None, line)),
116 }116 }
git-mailmap/src/snapshot/signature.rs+1−1
@@ -51,7 +51,7 @@ impl<'a> ResolvedSignature<'a> { · 50 unmodified lines
51 ) -> Option<Self> {51 ) -> Option<Self> {
52 let new_email = new_email52 let new_email = new_email
53 .map(|n| n.as_bstr())53 .map(|n| n.as_bstr())
54 .or_else(|| (matched_email != current_email).then(|| matched_email));54 .or_else(|| (matched_email != current_email).then_some(matched_email));
55 match (new_email, new_name) {55 match (new_email, new_name) {
56 (None, None) => None,56 (None, None) => None,
57 (new_email, new_name) => Some(ResolvedSignature {57 (new_email, new_name) => Some(ResolvedSignature {
git-odb/src/store_impls/dynamic/handle.rs+2−2
@@ -44,7 +44,7 @@ impl<'a> IntraPackLookup<'a> { · 43 unmodified lines
44 required_pack_index,44 required_pack_index,
45 } => index.lookup(id).and_then(|entry_index| {45 } => index.lookup(id).and_then(|entry_index| {
46 let (pack_index, pack_offset) = index.pack_id_and_pack_offset_at_index(entry_index);46 let (pack_index, pack_offset) = index.pack_id_and_pack_offset_at_index(entry_index);
47 (pack_index == *required_pack_index).then(|| pack_offset)47 (pack_index == *required_pack_index).then_some(pack_offset)
48 }),48 }),
49 }49 }
50 }50 }
@@ -90,7 +90,7 @@ pub(crate) mod index_lookup { · 39 unmodified lines
90 "BUG: multi-pack index must be set if this is a multi-pack, pack-indices seem unstable",90 "BUG: multi-pack index must be set if this is a multi-pack, pack-indices seem unstable",
91 );91 );
92 Box::new(index.iter().filter_map(move |e| {92 Box::new(index.iter().filter_map(move |e| {
93 (e.pack_index == pack_index).then(|| git_pack::index::Entry {93 (e.pack_index == pack_index).then_some(git_pack::index::Entry {
94 oid: e.oid,94 oid: e.oid,
95 pack_offset: e.pack_offset,95 pack_offset: e.pack_offset,
96 crc32: None,96 crc32: None,
git-odb/src/store_impls/dynamic/load_index.rs+4−4
@@ -111,7 +111,7 @@ impl super::Store { · 110 unmodified lines
111 match index111 match index
112 .next_index_to_load112 .next_index_to_load
113 .fetch_update(Ordering::SeqCst, Ordering::SeqCst, |current| {113 .fetch_update(Ordering::SeqCst, Ordering::SeqCst, |current| {
114 (current != index.slot_indices.len()).then(|| current + 1)114 (current != index.slot_indices.len()).then_some(current + 1)
115 }) {115 }) {
116 Ok(slot_map_index) => {116 Ok(slot_map_index) => {
117 // This slot-map index is in bounds and was only given to us.117 // This slot-map index is in bounds and was only given to us.
@@ -230,7 +230,7 @@ impl super::Store { · 112 unmodified lines
230 let indices_by_modification_time = Self::collect_indices_and_mtime_sorted_by_size(230 let indices_by_modification_time = Self::collect_indices_and_mtime_sorted_by_size(
231 db_paths,231 db_paths,
232 index.slot_indices.len().into(),232 index.slot_indices.len().into(),
233 self.use_multi_pack_index.then(|| self.object_hash),233 self.use_multi_pack_index.then_some(self.object_hash),
234 )?;234 )?;
235 let mut idx_by_index_path: BTreeMap<_, _> = index235 let mut idx_by_index_path: BTreeMap<_, _> = index
236 .slot_indices236 .slot_indices
@@ -479,7 +479,7 @@ impl super::Store { · 242 unmodified lines
479 (path != multi_index.path()479 (path != multi_index.path()
480 && !index_names_in_multi_index480 && !index_names_in_multi_index
481 .contains(&Path::new(path.file_name().expect("file name present"))))481 .contains(&Path::new(path.file_name().expect("file name present"))))
482 .then(|| (Either::IndexPath(path), a, b))482 .then_some((Either::IndexPath(path), a, b))
483 })483 })
484 .collect();484 .collect();
485 indices_not_in_multi_index.insert(0, (Either::MultiIndexFile(Arc::new(multi_index)), mtime, flen));485 indices_not_in_multi_index.insert(0, (Either::MultiIndexFile(Arc::new(multi_index)), mtime, flen));
@@ -488,7 +488,7 @@ impl super::Store { · 2 unmodified lines
488 indices_by_modification_time.extend(488 indices_by_modification_time.extend(
489 indices489 indices
490 .into_iter()490 .into_iter()
491 .filter_map(|(p, a, b)| (!is_multipack_index(&p)).then(|| (Either::IndexPath(p), a, b))),491 .filter_map(|(p, a, b)| (!is_multipack_index(&p)).then_some((Either::IndexPath(p), a, b))),
492 )492 )
493 }493 }
494 }494 }
git-pack/src/data/input/lookup_ref_delta_objects.rs+2−1
@@ -155,7 +155,8 @@ where · 154 unmodified lines
155 self.inserted_entry_length_at_offset155 self.inserted_entry_length_at_offset
156 .get(maybe_index_of_actual_entry)156 .get(maybe_index_of_actual_entry)
157 .and_then(|c| {157 .and_then(|c| {
158 (c.pack_offset == base_pack_offset).then(|| maybe_index_of_actual_entry)158 (c.pack_offset == base_pack_offset)
159 .then_some(maybe_index_of_actual_entry)
159 })160 })
160 .unwrap_or(index)161 .unwrap_or(index)
161 };162 };
git-pack/src/data/output/entry/iter_from_counts.rs+1−1
@@ -178,7 +178,7 @@ where · 177 unmodified lines
178 count,178 count,
179 counts_in_pack,179 counts_in_pack,
180 base_index_offset,180 base_index_offset,
181 allow_thin_pack.then(|| {181 allow_thin_pack.then_some({
182 |pack_id, base_offset| {182 |pack_id, base_offset| {
183 let (cached_pack_id, cache) = pack_offsets_to_id.get_or_insert_with(|| {183 let (cached_pack_id, cache) = pack_offsets_to_id.get_or_insert_with(|| {
184 db.pack_offsets_and_oid(pack_id)184 db.pack_offsets_and_oid(pack_id)
git-pack/src/multi_index/chunk.rs+2−2
@@ -244,7 +244,7 @@ pub mod large_offsets { · 243 unmodified lines
244 }244 }
245 }245 }
246 246
247 needs_large_offsets.then(|| num_large_offsets)247 needs_large_offsets.then_some(num_large_offsets)
248 }248 }
249 /// Returns true if the `offsets` range seems to be properly aligned for the data we expect.249 /// Returns true if the `offsets` range seems to be properly aligned for the data we expect.
250 pub fn is_valid(offset: &Range<usize>) -> bool {250 pub fn is_valid(offset: &Range<usize>) -> bool {
@@ -258,7 +258,7 @@ pub mod large_offsets { · 7 unmodified lines
258 ) -> std::io::Result<()> {258 ) -> std::io::Result<()> {
259 for offset in sorted_entries259 for offset in sorted_entries
260 .iter()260 .iter()
261 .filter_map(|e| (e.pack_offset > LARGE_OFFSET_THRESHOLD).then(|| e.pack_offset))261 .filter_map(|e| (e.pack_offset > LARGE_OFFSET_THRESHOLD).then_some(e.pack_offset))
262 {262 {
263 out.write_all(&offset.to_be_bytes())?;263 out.write_all(&offset.to_be_bytes())?;
264 num_large_offsets = num_large_offsets264 num_large_offsets = num_large_offsets
git-pack/src/multi_index/init.rs+3−3
@@ -104,7 +104,7 @@ impl TryFrom<&Path> for File { · 103 unmodified lines
104 104
105 let lookup = chunks.validated_usize_offset_by_id(chunk::lookup::ID, |offset| {105 let lookup = chunks.validated_usize_offset_by_id(chunk::lookup::ID, |offset| {
106 chunk::lookup::is_valid(&offset, object_hash, num_objects)106 chunk::lookup::is_valid(&offset, object_hash, num_objects)
107 .then(|| offset)107 .then_some(offset)
108 .ok_or(Error::InvalidChunkSize {108 .ok_or(Error::InvalidChunkSize {
109 id: chunk::lookup::ID,109 id: chunk::lookup::ID,
110 message: "The chunk with alphabetically ordered object ids doesn't have the correct size",110 message: "The chunk with alphabetically ordered object ids doesn't have the correct size",
@@ -112,7 +112,7 @@ impl TryFrom<&Path> for File { · 1 unmodified line
112 })??;112 })??;
113 let offsets = chunks.validated_usize_offset_by_id(chunk::offsets::ID, |offset| {113 let offsets = chunks.validated_usize_offset_by_id(chunk::offsets::ID, |offset| {
114 chunk::offsets::is_valid(&offset, num_objects)114 chunk::offsets::is_valid(&offset, num_objects)
115 .then(|| offset)115 .then_some(offset)
116 .ok_or(Error::InvalidChunkSize {116 .ok_or(Error::InvalidChunkSize {
117 id: chunk::offsets::ID,117 id: chunk::offsets::ID,
118 message: "The chunk with offsets into the pack doesn't have the correct size",118 message: "The chunk with offsets into the pack doesn't have the correct size",
@@ -121,7 +121,7 @@ impl TryFrom<&Path> for File { · 2 unmodified lines
121 let large_offsets = chunks121 let large_offsets = chunks
122 .validated_usize_offset_by_id(chunk::large_offsets::ID, |offset| {122 .validated_usize_offset_by_id(chunk::large_offsets::ID, |offset| {
123 chunk::large_offsets::is_valid(&offset)123 chunk::large_offsets::is_valid(&offset)
124 .then(|| offset)124 .then_some(offset)
125 .ok_or(Error::InvalidChunkSize {125 .ok_or(Error::InvalidChunkSize {
126 id: chunk::large_offsets::ID,126 id: chunk::large_offsets::ID,
127 message: "The chunk with large offsets into the pack doesn't have the correct size",127 message: "The chunk with large offsets into the pack doesn't have the correct size",
git-pack/src/verify.rs+1−1
@@ -22,7 +22,7 @@ pub mod checksum { · 21 unmodified lines
22pub fn fan(data: &[u32]) -> Option<usize> {22pub fn fan(data: &[u32]) -> Option<usize> {
23 data.windows(2)23 data.windows(2)
24 .enumerate()24 .enumerate()
25 .find_map(|(win_index, v)| (v[0] > v[1]).then(|| win_index))25 .find_map(|(win_index, v)| (v[0] > v[1]).then_some(win_index))
26}26}
27 27
28/// Calculate the hash of the given kind by trying to read the file from disk at `data_path` or falling back on the mapped content in `data`.28/// Calculate the hash of the given kind by trying to read the file from disk at `data_path` or falling back on the mapped content in `data`.
git-prompt/Cargo.toml+2−2
@@ -23,5 +23,5 @@ nix = { version = "0.26.1", default-features = false, features = ["term"] } · 22 unmodified lines
23 23
24[dev-dependencies]24[dev-dependencies]
25git-testtools = { path = "../tests/tools"}25git-testtools = { path = "../tests/tools"}
26serial_test = "0.9.0"26serial_test = "0.10.0"
27expectrl = "0.5.2"27expectrl = "0.6.0"
git-prompt/src/types.rs+1−1
@@ -75,7 +75,7 @@ impl Options<'_> { · 74 unmodified lines
75 .then(|| {75 .then(|| {
76 std::env::var_os("GIT_TERMINAL_PROMPT")76 std::env::var_os("GIT_TERMINAL_PROMPT")
77 .and_then(|val| git_config_value::Boolean::try_from(val).ok())77 .and_then(|val| git_config_value::Boolean::try_from(val).ok())
78 .and_then(|allow| (!allow.0).then(|| Mode::Disable))78 .and_then(|allow| (!allow.0).then_some(Mode::Disable))
79 })79 })
80 .flatten()80 .flatten()
81 .unwrap_or(self.mode);81 .unwrap_or(self.mode);
git-protocol/tests/fetch/response.rs+1−1
@@ -127,7 +127,7 @@ mod v2 { · 126 unmodified lines
127 for keepalive in [false, true] {127 for keepalive in [false, true] {
128 let fixture = format!(128 let fixture = format!(
129 "v2/clone-only{}.response",129 "v2/clone-only{}.response",
130 keepalive.then(|| "-with-keepalive").unwrap_or_default()130 keepalive.then_some("-with-keepalive").unwrap_or_default()
131 );131 );
132 let mut provider = mock_reader(&fixture);132 let mut provider = mock_reader(&fixture);
133 let mut reader = provider.as_read_without_sidebands();133 let mut reader = provider.as_read_without_sidebands();
git-protocol/tests/fetch/v1.rs+1−1
@@ -12,7 +12,7 @@ async fn clone() -> crate::Result { · 11 unmodified lines
12 let mut dlg = CloneDelegate::default();12 let mut dlg = CloneDelegate::default();
13 let fixture = format!(13 let fixture = format!(
14 "v1/clone{}.response",14 "v1/clone{}.response",
15 with_keepalive.then(|| "-with-keepalive").unwrap_or_default()15 with_keepalive.then_some("-with-keepalive").unwrap_or_default()
16 );16 );
17 git_protocol::fetch(17 git_protocol::fetch(
18 transport(18 transport(
git-ref/src/store/file/transaction/prepare.rs+1−1
@@ -417,7 +417,7 @@ fn possibly_adjust_name_for_prefixes(name: &FullNameRef) -> Option<FullName> { · 416 unmodified lines
417 MainRef | LinkedRef { .. } => sn417 MainRef | LinkedRef { .. } => sn
418 .category()418 .category()
419 .map_or(false, |cat| !cat.is_worktree_private())419 .map_or(false, |cat| !cat.is_worktree_private())
420 .then(|| sn),420 .then_some(sn),
421 }421 }
422 .map(|n| n.to_owned())422 .map(|n| n.to_owned())
423 }423 }
git-refspec/src/match_group/mod.rs+1−1
@@ -78,7 +78,7 @@ impl<'a> MatchGroup<'a> { · 77 unmodified lines
78 for matcher in matchers78 for matcher in matchers
79 .into_iter()79 .into_iter()
80 .zip(self.specs.iter())80 .zip(self.specs.iter())
81 .filter_map(|(m, spec)| m.and_then(|m| (spec.mode == Mode::Negative).then(|| m)))81 .filter_map(|(m, spec)| m.and_then(|m| (spec.mode == Mode::Negative).then_some(m)))
82 {82 {
83 out.retain(|m| match m.lhs {83 out.retain(|m| match m.lhs {
84 SourceRef::ObjectId(_) => true,84 SourceRef::ObjectId(_) => true,
git-refspec/src/match_group/util.rs+1−1
@@ -70,7 +70,7 @@ impl<'a> Needle<'a> { · 69 unmodified lines
70 }70 }
71 }71 }
72 Needle::PartialName(name) => crate::spec::expand_partial_name(name, |expanded| {72 Needle::PartialName(name) => crate::spec::expand_partial_name(name, |expanded| {
73 (expanded == item.full_ref_name).then(|| Match::Normal)73 (expanded == item.full_ref_name).then_some(Match::Normal)
74 })74 })
75 .unwrap_or(Match::None),75 .unwrap_or(Match::None),
76 Needle::Glob { name, asterisk_pos } => {76 Needle::Glob { name, asterisk_pos } => {
git-refspec/src/match_group/validate.rs+5−3
@@ -72,9 +72,11 @@ impl std::fmt::Display for Error { · 71 unmodified lines
72 f,72 f,
73 "Found {} {} the refspec mapping to be used: \n\t{}",73 "Found {} {} the refspec mapping to be used: \n\t{}",
74 self.issues.len(),74 self.issues.len(),
75 (self.issues.len() == 1)75 if self.issues.len() == 1 {
76 .then(|| "issue that prevents")76 "issue that prevents"
77 .unwrap_or("issues that prevent"),77 } else {
78 "issues that prevent"
79 },
78 self.issues80 self.issues
79 .iter()81 .iter()
80 .map(|issue| issue.to_string())82 .map(|issue| issue.to_string())
git-refspec/src/parse.rs+1−1
@@ -107,7 +107,7 @@ pub(crate) mod function { · 106 unmodified lines
107 }107 }
108 }108 }
109 None => {109 None => {
110 let src = (!spec.is_empty()).then(|| spec);110 let src = (!spec.is_empty()).then_some(spec);
111 if Operation::Fetch == operation && mode != Mode::Negative && src.is_none() {111 if Operation::Fetch == operation && mode != Mode::Negative && src.is_none() {
112 return Ok(fetch_head_only(mode));112 return Ok(fetch_head_only(mode));
113 } else {113 } else {
git-refspec/src/spec.rs+1−1
@@ -140,7 +140,7 @@ impl<'a> RefSpecRef<'a> { · 139 unmodified lines
140 let suffix = source.strip_prefix(b"refs/")?;140 let suffix = source.strip_prefix(b"refs/")?;
141 let slash_pos = suffix.find_byte(b'/')?;141 let slash_pos = suffix.find_byte(b'/')?;
142 let prefix = source[..="refs/".len() + slash_pos].as_bstr();142 let prefix = source[..="refs/".len() + slash_pos].as_bstr();
143 (!prefix.contains(&b'*')).then(|| prefix)143 (!prefix.contains(&b'*')).then_some(prefix)
144 }144 }
145 145
146 /// As opposed to [`prefix()`][Self::prefix], if the latter is `None` it will expand to all possible prefixes and place them in `out`.146 /// As opposed to [`prefix()`][Self::prefix], if the latter is `None` it will expand to all possible prefixes and place them in `out`.
git-repository/Cargo.toml+2−2
@@ -7,7 +7,7 @@ version = "0.32.0" · 6 unmodified lines
7authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]7authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
8edition = "2021"8edition = "2021"
9include = ["src/**/*", "CHANGELOG.md"]9include = ["src/**/*", "CHANGELOG.md"]
10rust-version = "1.60"10rust-version = "1.64"
11 11
12[lib]12[lib]
13doctest = false13doctest = false
@@ -151,7 +151,7 @@ git-testtools = { path = "../tests/tools" } · 137 unmodified lines
151is_ci = "1.1.1"151is_ci = "1.1.1"
152anyhow = "1"152anyhow = "1"
153walkdir = "2.3.2"153walkdir = "2.3.2"
154serial_test = "0.9.0"154serial_test = "0.10.0"
155async-std = { version = "1.12.0", features = ["attributes"] }155async-std = { version = "1.12.0", features = ["attributes"] }
156 156
157[package.metadata.docs.rs]157[package.metadata.docs.rs]
git-repository/src/config/cache/incubate.rs+1−1
@@ -37,7 +37,7 @@ impl StageOne { · 36 unmodified lines
37 .value::<git_config::Integer>("core", None, "repositoryFormatVersion")37 .value::<git_config::Integer>("core", None, "repositoryFormatVersion")
38 .map_or(0, |v| v.to_decimal().unwrap_or_default());38 .map_or(0, |v| v.to_decimal().unwrap_or_default());
39 let object_hash = (repo_format_version != 1)39 let object_hash = (repo_format_version != 1)
40 .then(|| Ok(git_hash::Kind::Sha1))40 .then_some(Ok(git_hash::Kind::Sha1))
41 .or_else(|| {41 .or_else(|| {
42 config.string("extensions", None, "objectFormat").map(|format| {42 config.string("extensions", None, "objectFormat").map(|format| {
43 if format.as_ref().eq_ignore_ascii_case(b"sha1") {43 if format.as_ref().eq_ignore_ascii_case(b"sha1") {
git-repository/src/config/cache/util.rs+9−6
@@ -46,8 +46,11 @@ pub(crate) fn query_refupdates( · 45 unmodified lines
46 .boolean("core", None, "logAllRefUpdates")46 .boolean("core", None, "logAllRefUpdates")
47 .and_then(|b| b.ok())47 .and_then(|b| b.ok())
48 .map(|b| {48 .map(|b| {
49 b.then(|| git_ref::store::WriteReflog::Normal)49 if b {
50 .unwrap_or(git_ref::store::WriteReflog::Disable)50 git_ref::store::WriteReflog::Normal
51 } else {
52 git_ref::store::WriteReflog::Disable
53 }
51 }) {54 }) {
52 Some(val) => Ok(Some(val)),55 Some(val) => Ok(Some(val)),
53 None => match config.string("core", None, "logAllRefUpdates") {56 None => match config.string("core", None, "logAllRefUpdates") {
@@ -97,10 +100,10 @@ pub(crate) fn reflog_or_default( · 43 unmodified lines
97 config_reflog: Option<git_ref::store::WriteReflog>,100 config_reflog: Option<git_ref::store::WriteReflog>,
98 has_worktree: bool,101 has_worktree: bool,
99) -> git_ref::store::WriteReflog {102) -> git_ref::store::WriteReflog {
100 config_reflog.unwrap_or_else(|| {103 config_reflog.unwrap_or(if has_worktree {
101 has_worktree104 git_ref::store::WriteReflog::Normal
102 .then(|| git_ref::store::WriteReflog::Normal)105 } else {
103 .unwrap_or(git_ref::store::WriteReflog::Disable)106 git_ref::store::WriteReflog::Disable
104 })107 })
105}108}
106 109
git-repository/src/config/snapshot/credential_helpers.rs+3−2
@@ -73,7 +73,7 @@ impl Snapshot<'_> { · 72 unmodified lines
73 let ports = is_http73 let ports = is_http
74 .then(|| (pattern.port_or_default(), url.port_or_default()))74 .then(|| (pattern.port_or_default(), url.port_or_default()))
75 .unwrap_or((pattern.port, url.port));75 .unwrap_or((pattern.port, url.port));
76 let path = (!(is_http && pattern.path_is_root())).then(|| &pattern.path);76 let path = (!(is_http && pattern.path_is_root())).then_some(&pattern.path);
77 77
78 if !path.map_or(true, |path| path == &url.path) {78 if !path.map_or(true, |path| path == &url.path) {
79 return None;79 return None;
@@ -81,7 +81,8 @@ impl Snapshot<'_> { · 1 unmodified line
81 if pattern.user().is_some() && pattern.user() != url.user() {81 if pattern.user().is_some() && pattern.user() != url.user() {
82 return None;82 return None;
83 }83 }
84 (scheme == &url.scheme && host_matches(host, url.host()) && ports.0 == ports.1).then(|| section)84 (scheme == &url.scheme && host_matches(host, url.host()) && ports.0 == ports.1)
85 .then_some(section)
85 }),86 }),
86 None => Some(section),87 None => Some(section),
87 };88 };
git-repository/src/create.rs+5−2
@@ -229,8 +229,11 @@ pub fn into( · 228 unmodified lines
229 229
230 Ok(git_discover::repository::Path::from_dot_git_dir(230 Ok(git_discover::repository::Path::from_dot_git_dir(
231 dot_git,231 dot_git,
232 bare.then(|| git_discover::repository::Kind::Bare)232 if bare {
233 .unwrap_or(git_discover::repository::Kind::WorkTree { linked_git_dir: None }),233 git_discover::repository::Kind::Bare
234 } else {
235 git_discover::repository::Kind::WorkTree { linked_git_dir: None }
236 },
234 std::env::current_dir()?,237 std::env::current_dir()?,
235 )238 )
236 .expect("by now the `dot_git` dir is valid as we have accessed it"))239 .expect("by now the `dot_git` dir is valid as we have accessed it"))
git-repository/src/remote/connection/fetch/mod.rs+6−2
@@ -171,7 +171,7 @@ where · 170 unmodified lines
171 ///171 ///
172 /// This works by not actually fetching the pack after negotiating it, nor will refs be updated.172 /// This works by not actually fetching the pack after negotiating it, nor will refs be updated.
173 pub fn with_dry_run(mut self, enabled: bool) -> Self {173 pub fn with_dry_run(mut self, enabled: bool) -> Self {
174 self.dry_run = enabled.then(|| DryRun::Yes).unwrap_or(DryRun::No);174 self.dry_run = if enabled { DryRun::Yes } else { DryRun::No };
175 self175 self
176 }176 }
177 177
@@ -180,7 +180,11 @@ where · 2 unmodified lines
180 /// This improves performance and allows case-sensitive filesystems to deal with ref names that would otherwise180 /// This improves performance and allows case-sensitive filesystems to deal with ref names that would otherwise
181 /// collide.181 /// collide.
182 pub fn with_write_packed_refs_only(mut self, enabled: bool) -> Self {182 pub fn with_write_packed_refs_only(mut self, enabled: bool) -> Self {
183 self.write_packed_refs = enabled.then(|| WritePackedRefs::Only).unwrap_or(WritePackedRefs::Never);183 self.write_packed_refs = if enabled {
184 WritePackedRefs::Only
185 } else {
186 WritePackedRefs::Never
187 };
184 self188 self
185 }189 }
186 190
git-repository/src/remote/save.rs+1−1
@@ -45,7 +45,7 @@ impl Remote<'_> { · 44 unmodified lines
45 .to_owned(),45 .to_owned(),
46 })?;46 })?;
47 if let Some(section_ids) = config.sections_and_ids_by_name("remote").map(|it| {47 if let Some(section_ids) = config.sections_and_ids_by_name("remote").map(|it| {
48 it.filter_map(|(s, id)| (s.header().subsection_name() == Some(name.as_bstr())).then(|| id))48 it.filter_map(|(s, id)| (s.header().subsection_name() == Some(name.as_bstr())).then_some(id))
49 .collect::<Vec<_>>()49 .collect::<Vec<_>>()
50 }) {50 }) {
51 let mut sections_to_remove = Vec::new();51 let mut sections_to_remove = Vec::new();
git-repository/src/remote/url/rewrite.rs+1−1
@@ -70,7 +70,7 @@ impl Rewrite { · 69 unmodified lines
70 None70 None
71 } else {71 } else {
72 let mut url = url.to_bstring();72 let mut url = url.to_bstring();
73 self.rewrite_url_in_place(&mut url, direction).then(|| url)73 self.rewrite_url_in_place(&mut url, direction).then_some(url)
74 }74 }
75 }75 }
76 76
git-repository/src/repository/config/transport.rs+5−2
@@ -235,8 +235,11 @@ impl crate::Repository { · 234 unmodified lines
235 .transpose()235 .transpose()
236 .with_leniency(lenient)?236 .with_leniency(lenient)?
237 {237 {
238 val.then(|| http::options::FollowRedirects::All)238 if val {
239 .unwrap_or(http::options::FollowRedirects::None)239 http::options::FollowRedirects::All
240 } else {
241 http::options::FollowRedirects::None
242 }
240 } else {243 } else {
241 http::options::FollowRedirects::Initial244 http::options::FollowRedirects::Initial
242 };245 };
git-repository/src/revision/spec/parse/delegate/mod.rs+1−1
@@ -116,7 +116,7 @@ impl<'repo> parse::Delegate for Delegate<'repo> { · 115 unmodified lines
116 self.follow_refs_to_objects_if_needed();116 self.follow_refs_to_objects_if_needed();
117 self.disambiguate_objects_by_fallback_hint(117 self.disambiguate_objects_by_fallback_hint(
118 self.kind_implies_committish()118 self.kind_implies_committish()
119 .then(|| ObjectKindHint::Committish)119 .then_some(ObjectKindHint::Committish)
120 .or(self.opts.object_kind_hint),120 .or(self.opts.object_kind_hint),
121 );121 );
122 }122 }
git-repository/src/worktree/mod.rs+2−2
@@ -63,7 +63,7 @@ pub(crate) fn id(git_dir: &std::path::Path, has_common_dir: bool) -> Option<&BSt · 62 unmodified lines
63 let candidate = git_path::os_str_into_bstr(git_dir.file_name().expect("at least one directory level"))63 let candidate = git_path::os_str_into_bstr(git_dir.file_name().expect("at least one directory level"))
64 .expect("no illformed UTF-8");64 .expect("no illformed UTF-8");
65 let maybe_worktrees = git_dir.parent()?;65 let maybe_worktrees = git_dir.parent()?;
66 (maybe_worktrees.file_name()?.to_str()? == "worktrees").then(|| candidate)66 (maybe_worktrees.file_name()?.to_str()? == "worktrees").then_some(candidate)
67}67}
68 68
69///69///
@@ -130,7 +130,7 @@ pub mod excludes { · 60 unmodified lines
130 let case = repo130 let case = repo
131 .config131 .config
132 .ignore_case132 .ignore_case
133 .then(|| git_glob::pattern::Case::Fold)133 .then_some(git_glob::pattern::Case::Fold)
134 .unwrap_or_default();134 .unwrap_or_default();
135 let mut buf = Vec::with_capacity(512);135 let mut buf = Vec::with_capacity(512);
136 let excludes_file = match repo.config.excludes_file().transpose()? {136 let excludes_file = match repo.config.excludes_file().transpose()? {
git-repository/tests/revision/spec/from_bytes/util.rs+1−1
@@ -45,7 +45,7 @@ static BASELINE: Lazy<HashMap<PathBuf, HashMap<BString, Option<git_revision::Spe · 44 unmodified lines
45 .max_depth(2)45 .max_depth(2)
46 .follow_links(false)46 .follow_links(false)
47 .into_iter()47 .into_iter()
48 .filter_map(|e| e.ok().and_then(|e| (e.file_name() == "baseline.git").then(|| e)))48 .filter_map(|e| e.ok().and_then(|e| (e.file_name() == "baseline.git").then_some(e)))
49 {49 {
50 let map = baseline_map50 let map = baseline_map
51 .entry(baseline_entry.path().parent().expect("file in directory").into())51 .entry(baseline_entry.path().parent().expect("file in directory").into())
git-revision/src/spec/parse/function.rs+3−3
@@ -206,7 +206,7 @@ fn long_describe_prefix(name: &BStr) -> Option<(&BStr, delegate::PrefixHint<'_>) · 205 unmodified lines
206 rest.iter().all(|b| b.is_ascii_hexdigit()).then(|| rest.as_bstr())206 rest.iter().all(|b| b.is_ascii_hexdigit()).then(|| rest.as_bstr())
207 })?;207 })?;
208 208
209 let candidate = iter.clone().any(|token| !token.is_empty()).then(|| candidate);209 let candidate = iter.clone().any(|token| !token.is_empty()).then_some(candidate);
210 let hint = iter210 let hint = iter
211 .next()211 .next()
212 .and_then(|gen| gen.to_str().ok().and_then(|gen| usize::from_str(gen).ok()))212 .and_then(|gen| gen.to_str().ok().and_then(|gen| usize::from_str(gen).ok()))
@@ -235,7 +235,7 @@ fn short_describe_prefix(name: &BStr) -> Option<&BStr> { · 22 unmodified lines
235 let candidate = iter235 let candidate = iter
236 .next()236 .next()
237 .and_then(|prefix| prefix.iter().all(|b| b.is_ascii_hexdigit()).then(|| prefix.as_bstr()));237 .and_then(|prefix| prefix.iter().all(|b| b.is_ascii_hexdigit()).then(|| prefix.as_bstr()));
238 (iter.count() == 1).then(|| candidate).flatten()238 (iter.count() == 1).then_some(candidate).flatten()
239}239}
240 240
241type InsideParensRestConsumed<'a> = (std::borrow::Cow<'a, BStr>, &'a BStr, usize);241type InsideParensRestConsumed<'a> = (std::borrow::Cow<'a, BStr>, &'a BStr, usize);
@@ -388,7 +388,7 @@ where · 146 unmodified lines
388 try_set_prefix(delegate, prefix, hint)388 try_set_prefix(delegate, prefix, hint)
389 })389 })
390 .or_else(|| {390 .or_else(|| {
391 name.is_empty().then(|| ()).or_else(|| {391 name.is_empty().then_some(()).or_else(|| {
392 #[allow(clippy::let_unit_value)]392 #[allow(clippy::let_unit_value)]
393 {393 {
394 let res = delegate.find_ref(name)?;394 let res = delegate.find_ref(name)?;
git-sec/Cargo.toml+1−1
@@ -27,7 +27,7 @@ libc = "0.2.123" · 26 unmodified lines
27[target.'cfg(windows)'.dependencies]27[target.'cfg(windows)'.dependencies]
28git-path = { version = "^0.7.0", path = "../git-path" }28git-path = { version = "^0.7.0", path = "../git-path" }
29dirs = "4"29dirs = "4"
30windows = { version = "0.40.0", features = [30windows = { version = "0.43.0", features = [
31 "Win32_Foundation",31 "Win32_Foundation",
32 "Win32_Security_Authorization",32 "Win32_Security_Authorization",
33 "Win32_Storage_FileSystem",33 "Win32_Storage_FileSystem",
git-sec/src/identity.rs+10−2
@@ -119,10 +119,18 @@ mod impl_ { · 118 unmodified lines
119 119
120 let mut buffer_size = 0;120 let mut buffer_size = 0;
121 let mut buffer = Vec::<u8>::new();121 let mut buffer = Vec::<u8>::new();
122 GetTokenInformation(token, TokenOwner, None, &mut buffer_size);122 GetTokenInformation(token, TokenOwner, None, 0, &mut buffer_size);
123 if buffer_size != 0 {123 if buffer_size != 0 {
124 buffer.resize(buffer_size as usize, 0);124 buffer.resize(buffer_size as usize, 0);
125 if GetTokenInformation(token, TokenOwner, Some(buffer.as_mut_slice()), &mut buffer_size).as_bool() {125 if GetTokenInformation(
126 token,
127 TokenOwner,
128 Some(buffer.as_mut_ptr() as *mut std::ffi::c_void),
129 buffer_size,
130 &mut buffer_size,
131 )
132 .as_bool()
133 {
126 let token_owner = buffer.as_ptr() as *const TOKEN_OWNER;134 let token_owner = buffer.as_ptr() as *const TOKEN_OWNER;
127 let token_owner = (*token_owner).Owner;135 let token_owner = (*token_owner).Owner;
128 136
git-sec/src/trust.rs+5−3
@@ -3,9 +3,11 @@ use crate::Trust; · 2 unmodified lines
3impl Trust {3impl Trust {
4 /// Derive `Full` trust if `path` is owned by the user executing the current process, or `Reduced` trust otherwise.4 /// Derive `Full` trust if `path` is owned by the user executing the current process, or `Reduced` trust otherwise.
5 pub fn from_path_ownership(path: impl AsRef<std::path::Path>) -> std::io::Result<Self> {5 pub fn from_path_ownership(path: impl AsRef<std::path::Path>) -> std::io::Result<Self> {
6 Ok(crate::identity::is_path_owned_by_current_user(path.as_ref())?6 Ok(if crate::identity::is_path_owned_by_current_user(path.as_ref())? {
7 .then(|| Trust::Full)7 Trust::Full
8 .unwrap_or(Trust::Reduced))8 } else {
9 Trust::Reduced
10 })
9 }11 }
10}12}
11 13
git-tempfile/src/fs/remove_dir.rs+1−1
@@ -51,7 +51,7 @@ impl<'a> Iterator for Iter<'a> { · 50 unmodified lines
51 },51 },
52 };52 };
53 self.cursor = match dir.parent() {53 self.cursor = match dir.parent() {
54 Some(parent) => (parent != self.boundary).then(|| parent),54 Some(parent) => (parent != self.boundary).then_some(parent),
55 None => {55 None => {
56 unreachable!("directory {:?} ran out of parents, this really shouldn't happen before hitting the boundary {:?}", dir, self.boundary)56 unreachable!("directory {:?} ran out of parents, this really shouldn't happen before hitting the boundary {:?}", dir, self.boundary)
57 }57 }
git-transport/Cargo.toml+1−1
@@ -70,7 +70,7 @@ futures-lite = { version = "1.12.0", optional = true } · 69 unmodified lines
70pin-project-lite = { version = "0.2.6", optional = true }70pin-project-lite = { version = "0.2.6", optional = true }
71 71
72# for http-client72# for http-client
73base64 = { version = "0.13.0", optional = true }73base64 = { version = "0.21.0", optional = true }
74 74
75# for http-client-curl. Additional configuration should be performed on higher levels of the dependency tree.75# for http-client-curl. Additional configuration should be performed on higher levels of the dependency tree.
76curl = { version = "0.4", optional = true }76curl = { version = "0.4", optional = true }
git-transport/src/client/blocking_io/file.rs+1−1
@@ -91,7 +91,7 @@ impl client::TransportWithoutIO for SpawnProcessOnDemand { · 90 unmodified lines
91 fn set_identity(&mut self, identity: git_sec::identity::Account) -> Result<(), client::Error> {91 fn set_identity(&mut self, identity: git_sec::identity::Account) -> Result<(), client::Error> {
92 if self.url.scheme == git_url::Scheme::Ssh {92 if self.url.scheme == git_url::Scheme::Ssh {
93 self.url93 self.url
94 .set_user((!identity.username.is_empty()).then(|| identity.username));94 .set_user((!identity.username.is_empty()).then_some(identity.username));
95 Ok(())95 Ok(())
96 } else {96 } else {
97 Err(client::Error::AuthenticationUnsupported)97 Err(client::Error::AuthenticationUnsupported)
git-transport/src/client/blocking_io/http/curl/remote.rs+5−3
@@ -308,9 +308,11 @@ pub fn new() -> ( · 307 unmodified lines
308 authenticate.lock().expect("no panics in other threads")(action.erase()).ok();308 authenticate.lock().expect("no panics in other threads")(action.erase()).ok();
309 }309 }
310 let err = Err(io::Error::new(310 let err = Err(io::Error::new(
311 curl_is_spurious(&err)311 if curl_is_spurious(&err) {
312 .then(|| std::io::ErrorKind::ConnectionReset)312 std::io::ErrorKind::ConnectionReset
313 .unwrap_or(std::io::ErrorKind::Other),313 } else {
314 std::io::ErrorKind::Other
315 },
314 err,316 err,
315 ));317 ));
316 handler.receive_body.take();318 handler.receive_body.take();
git-transport/src/client/blocking_io/http/mod.rs+3−2
@@ -1,3 +1,4 @@
1use base64::Engine;
1use std::{2use std::{
2 any::Any,3 any::Any,
3 borrow::Cow,4 borrow::Cow,
@@ -8,7 +9,7 @@ use std::{ · 4 unmodified lines
8 9
9use bstr::BStr;10use bstr::BStr;
10use git_packetline::PacketLineRef;11use git_packetline::PacketLineRef;
11pub use traits::{Error, GetResponse, Http, PostResponse};12pub use traits::{Error, GetResponse, Http, PostBodyDataKind, PostResponse};
12 13
13use crate::{14use crate::{
14 client::{15 client::{
@@ -269,7 +270,7 @@ impl<H: Http> Transport<H> { · 254 unmodified lines
269 }270 }
270 headers.push(Cow::Owned(format!(271 headers.push(Cow::Owned(format!(
271 "Authorization: Basic {}",272 "Authorization: Basic {}",
272 base64::encode(format!("{}:{}", username, password))273 base64::engine::general_purpose::STANDARD.encode(format!("{}:{}", username, password))
273 )))274 )))
274 }275 }
275 Ok(())276 Ok(())
git-transport/src/client/blocking_io/ssh/mod.rs+6−3
@@ -97,7 +97,7 @@ pub fn connect( · 96 unmodified lines
97 let ssh_cmd = options.ssh_command();97 let ssh_cmd = options.ssh_command();
98 let mut kind = options.kind.unwrap_or_else(|| ProgramKind::from(ssh_cmd));98 let mut kind = options.kind.unwrap_or_else(|| ProgramKind::from(ssh_cmd));
99 if options.kind.is_none() && kind == ProgramKind::Simple {99 if options.kind.is_none() && kind == ProgramKind::Simple {
100 kind = std::process::Command::from(100 kind = if std::process::Command::from(
101 git_command::prepare(ssh_cmd)101 git_command::prepare(ssh_cmd)
102 .stderr(Stdio::null())102 .stderr(Stdio::null())
103 .stdout(Stdio::null())103 .stdout(Stdio::null())
@@ -109,8 +109,11 @@ pub fn connect( · 5 unmodified lines
109 .status()109 .status()
110 .ok()110 .ok()
111 .map_or(false, |status| status.success())111 .map_or(false, |status| status.success())
112 .then(|| ProgramKind::Ssh)112 {
113 .unwrap_or(ProgramKind::Simple);113 ProgramKind::Ssh
114 } else {
115 ProgramKind::Simple
116 };
114 }117 }
115 118
116 let path = git_url::expand_path::for_shell(url.path.clone());119 let path = git_url::expand_path::for_shell(url.path.clone());
git-url/src/parse.rs+1−1
@@ -40,7 +40,7 @@ fn guess_protocol(url: &[u8]) -> Option<&str> { · 39 unmodified lines
40 "ssh"40 "ssh"
41 } else {41 } else {
42 url.get(colon_pos + 1..).and_then(|from_colon| {42 url.get(colon_pos + 1..).and_then(|from_colon| {
43 (from_colon.contains(&b'/') || from_colon.contains(&b'\\')).then(|| "file")43 (from_colon.contains(&b'/') || from_colon.contains(&b'\\')).then_some("file")
44 })?44 })?
45 }45 }
46 }46 }
git-worktree/src/fs/cache/mod.rs+1−1
@@ -129,7 +129,7 @@ impl Cache { · 128 unmodified lines
129 129
130 self.at_path(130 self.at_path(
131 relative_path,131 relative_path,
132 is_dir.or_else(|| relative.ends_with_str("/").then(|| true)),132 is_dir.or_else(|| relative.ends_with_str("/").then_some(true)),
133 // is_dir,133 // is_dir,
134 find,134 find,
135 )135 )
git-worktree/src/fs/cache/state.rs+1−1
@@ -275,7 +275,7 @@ impl State { · 274 unmodified lines
275 Case::Sensitive => basename == t.0,275 Case::Sensitive => basename == t.0,
276 Case::Fold => basename.eq_ignore_ascii_case(t.0),276 Case::Fold => basename.eq_ignore_ascii_case(t.0),
277 }277 }
278 .then(|| t.1)278 .then_some(t.1)
279 })?;279 })?;
280 // See https://github.com/git/git/blob/master/dir.c#L912:L912280 // See https://github.com/git/git/blob/master/dir.c#L912:L912
281 if is_ignore && !entry.flags.contains(git_index::entry::Flags::SKIP_WORKTREE) {281 if is_ignore && !entry.flags.contains(git_index::entry::Flags::SKIP_WORKTREE) {
gitoxide-core/src/hours/mod.rs+3−3
@@ -382,8 +382,8 @@ where · 381 unmodified lines
382 for entry in results_by_hours.iter() {382 for entry in results_by_hours.iter() {
383 entry.write_to(383 entry.write_to(
384 total_hours,384 total_hours,
385 file_stats.then(|| total_files),385 file_stats.then_some(total_files),
386 line_stats.then(|| total_lines),386 line_stats.then_some(total_lines),
387 &mut out,387 &mut out,
388 )?;388 )?;
389 writeln!(out)?;389 writeln!(out)?;
@@ -395,7 +395,7 @@ where · 5 unmodified lines
395 total_hours,395 total_hours,
396 total_hours / HOURS_PER_WORKDAY,396 total_hours / HOURS_PER_WORKDAY,
397 total_commits,397 total_commits,
398 is_shallow.then(|| " (shallow)").unwrap_or_default(),398 is_shallow.then_some(" (shallow)").unwrap_or_default(),
399 num_authors399 num_authors
400 )?;400 )?;
401 if file_stats {401 if file_stats {
gitoxide-core/src/index/checkout.rs+1−1
@@ -124,7 +124,7 @@ pub fn checkout_exclusive( · 123 unmodified lines
124 progress.done(format!(124 progress.done(format!(
125 "Created {} {} files{} ({})",125 "Created {} {} files{} ({})",
126 files_updated,126 files_updated,
127 no_repo.then(|| "empty").unwrap_or_default(),127 no_repo.then_some("empty").unwrap_or_default(),
128 should_interrupt128 should_interrupt
129 .load(Ordering::Relaxed)129 .load(Ordering::Relaxed)
130 .then(|| {130 .then(|| {
gitoxide-core/src/repository/clone.rs+5−2
@@ -52,8 +52,11 @@ pub(crate) mod function { · 51 unmodified lines
52 let mut prepare = git::clone::PrepareFetch::new(52 let mut prepare = git::clone::PrepareFetch::new(
53 url,53 url,
54 directory,54 directory,
55 bare.then(|| git::create::Kind::Bare)55 if bare {
56 .unwrap_or(git::create::Kind::WithWorktree),56 git::create::Kind::Bare
57 } else {
58 git::create::Kind::WithWorktree
59 },
57 git::create::Options::default(),60 git::create::Options::default(),
58 {61 {
59 let mut opts = git::open::Options::default().config_overrides(overrides);62 let mut opts = git::open::Options::default().config_overrides(overrides);
gitoxide-core/src/repository/config.rs+1−1
@@ -102,7 +102,7 @@ fn write_meta(meta: &git::config::file::Metadata, out: &mut impl std::io::Write) · 101 unmodified lines
102 .then(|| format!(", include level {}", meta.level))102 .then(|| format!(", include level {}", meta.level))
103 .unwrap_or_default(),103 .unwrap_or_default(),
104 (meta.trust != git::sec::Trust::Full)104 (meta.trust != git::sec::Trust::Full)
105 .then(|| ", untrusted")105 .then_some(", untrusted")
106 .unwrap_or_default()106 .unwrap_or_default()
107 )107 )
108}108}
gitoxide-core/src/repository/exclude.rs+1−1
@@ -51,7 +51,7 @@ pub fn query( · 50 unmodified lines
51 let entry = cache.at_entry(path, is_dir, |oid, buf| repo.objects.find_blob(oid, buf))?;51 let entry = cache.at_entry(path, is_dir, |oid, buf| repo.objects.find_blob(oid, buf))?;
52 let match_ = entry52 let match_ = entry
53 .matching_exclude_pattern()53 .matching_exclude_pattern()
54 .and_then(|m| (show_ignore_patterns || !m.pattern.is_negative()).then(|| m));54 .and_then(|m| (show_ignore_patterns || !m.pattern.is_negative()).then_some(m));
55 match match_ {55 match match_ {
56 Some(m) => writeln!(56 Some(m) => writeln!(
57 out,57 out,
gitoxide-core/src/repository/remote.rs+7−3
@@ -156,9 +156,13 @@ mod refs_impl { · 155 unmodified lines
156 match repo.try_find_reference(local)? {156 match repo.try_find_reference(local)? {
157 Some(tracking) => {157 Some(tracking) => {
158 let msg = match tracking.try_id() {158 let msg = match tracking.try_id() {
159 Some(id) => (id.as_ref() == target_id)159 Some(id) => {
160 .then(|| "[up-to-date]")160 if id.as_ref() == target_id {
161 .unwrap_or("[changed]"),161 "[up-to-date]"
162 } else {
163 "[changed]"
164 }
165 }
162 None => "[skipped]",166 None => "[skipped]",
163 };167 };
164 writeln!(out, "{msg}")168 writeln!(out, "{msg}")
gitoxide-core/src/repository/tree.rs+3−3
@@ -130,12 +130,12 @@ pub fn info( · 129 unmodified lines
130 130
131 let tree = treeish_to_tree(treeish, &repo)?;131 let tree = treeish_to_tree(treeish, &repo)?;
132 132
133 let mut delegate = entries::Traverse::new(extended.then(|| &repo), None);133 let mut delegate = entries::Traverse::new(extended.then_some(&repo), None);
134 tree.traverse().breadthfirst(&mut delegate)?;134 tree.traverse().breadthfirst(&mut delegate)?;
135 135
136 #[cfg(feature = "serde1")]136 #[cfg(feature = "serde1")]
137 {137 {
138 delegate.stats.bytes = extended.then(|| delegate.stats.num_bytes);138 delegate.stats.bytes = extended.then_some(delegate.stats.num_bytes);
139 serde_json::to_writer_pretty(out, &delegate.stats)?;139 serde_json::to_writer_pretty(out, &delegate.stats)?;
140 }140 }
141 141
@@ -157,7 +157,7 @@ pub fn entries( · 15 unmodified lines
157 let tree = treeish_to_tree(treeish, &repo)?;157 let tree = treeish_to_tree(treeish, &repo)?;
158 158
159 if recursive {159 if recursive {
160 let mut delegate = entries::Traverse::new(extended.then(|| &repo), Some(&mut out));160 let mut delegate = entries::Traverse::new(extended.then_some(&repo), Some(&mut out));
161 tree.traverse().breadthfirst(&mut delegate)?;161 tree.traverse().breadthfirst(&mut delegate)?;
162 } else {162 } else {
163 for entry in tree.iter() {163 for entry in tree.iter() {
src/plumbing/main.rs+2−2
@@ -389,7 +389,7 @@ pub fn main() -> Result<()> { · 388 unmodified lines
389 let context = core::pack::create::Context {389 let context = core::pack::create::Context {
390 thread_limit,390 thread_limit,
391 thin,391 thin,
392 nondeterministic_thread_count: nondeterministic_count.then(|| counting_threads),392 nondeterministic_thread_count: nondeterministic_count.then_some(counting_threads),
393 pack_cache_size_in_bytes: pack_cache_size_mb.unwrap_or(0) * 1_000_000,393 pack_cache_size_in_bytes: pack_cache_size_mb.unwrap_or(0) * 1_000_000,
394 object_cache_size_in_bytes: object_cache_size_mb.unwrap_or(0) * 1_000_000,394 object_cache_size_in_bytes: object_cache_size_mb.unwrap_or(0) * 1_000_000,
395 statistics: if statistics { Some(format) } else { None },395 statistics: if statistics { Some(format) } else { None },
@@ -638,7 +638,7 @@ pub fn main() -> Result<()> { · 242 unmodified lines
638 progress,638 progress,
639 &should_interrupt,639 &should_interrupt,
640 core::repository::verify::Context {640 core::repository::verify::Context {
641 output_statistics: statistics.then(|| format),641 output_statistics: statistics.then_some(format),
642 algorithm,642 algorithm,
643 verify_mode: verify_mode(decode, re_encode),643 verify_mode: verify_mode(decode, re_encode),
644 thread_limit,644 thread_limit,
src/plumbing/progress.rs+15−4
@@ -1,3 +1,4 @@
1use std::borrow::Cow;
1use std::fmt::{Display, Formatter};2use std::fmt::{Display, Formatter};
2 3
3use crosstermion::crossterm::style::Stylize;4use crosstermion::crossterm::style::Stylize;
@@ -55,7 +56,13 @@ impl Usage { · 51 unmodified lines
55 NotApplicable { .. } => "❌",56 NotApplicable { .. } => "❌",
56 Planned { .. } => "🕒",57 Planned { .. } => "🕒",
57 NotPlanned { .. } => "🤔",58 NotPlanned { .. } => "🤔",
58 InModule { deviation, .. } => deviation.is_some().then(|| "👌️").unwrap_or("✅"),59 InModule { deviation, .. } => {
60 if deviation.is_some() {
61 "👌️"
62 } else {
63 "✅"
64 }
65 }
59 }66 }
60 }67 }
61}68}
@@ -69,7 +76,7 @@ struct Record { · 7 unmodified lines
69impl Tabled for Record {76impl Tabled for Record {
70 const LENGTH: usize = 3;77 const LENGTH: usize = 3;
71 78
72 fn fields(&self) -> Vec<String> {79 fn fields(&self) -> Vec<Cow<'_, str>> {
73 let mut tokens = self.config.split('.');80 let mut tokens = self.config.split('.');
74 let mut buf = vec![{81 let mut buf = vec![{
75 let name = tokens.next().expect("present");82 let name = tokens.next().expect("present");
@@ -82,10 +89,14 @@ impl Tabled for Record { · 6 unmodified lines
82 }];89 }];
83 buf.extend(tokens.map(ToOwned::to_owned));90 buf.extend(tokens.map(ToOwned::to_owned));
84 91
85 vec![self.usage.icon().into(), buf.join("."), self.usage.to_string()]92 vec![
93 Cow::Borrowed(self.usage.icon()),
94 buf.join(".").into(),
95 self.usage.to_string().into(),
96 ]
86 }97 }
87 98
88 fn headers() -> Vec<String> {99 fn headers() -> Vec<Cow<'static, str>> {
89 vec![]100 vec![]
90 }101 }
91}102}
tests/tools/src/lib.rs+1−1
@@ -62,7 +62,7 @@ static EXCLUDE_LUT: Lazy<Mutex<Option<git_worktree::fs::Cache>>> = Lazy::new(|| · 61 unmodified lines
62 let mut buf = Vec::with_capacity(512);62 let mut buf = Vec::with_capacity(512);
63 let case = git_worktree::fs::Capabilities::probe(&work_tree)63 let case = git_worktree::fs::Capabilities::probe(&work_tree)
64 .ignore_case64 .ignore_case
65 .then(|| git_attributes::glob::pattern::Case::Fold)65 .then_some(git_attributes::glob::pattern::Case::Fold)
66 .unwrap_or_default();66 .unwrap_or_default();
67 let state = git_worktree::fs::cache::State::IgnoreStack(git_worktree::fs::cache::state::Ignore::new(67 let state = git_worktree::fs::cache::State::IgnoreStack(git_worktree::fs::cache::state::Ignore::new(
68 Default::default(),68 Default::default(),