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
2020 runs-on: ${{ matrix.os }}
2121 steps:
2222 - uses: actions/checkout@v3
23− - uses: dtolnay/rust-toolchain@1.60.0 # dictated by `windows` crates effectively, IMPORTANT: adjust etc/msrv-badge.svg as well
23+ - uses: dtolnay/rust-toolchain@1.64.0 # dictated by `windows` crates effectively, IMPORTANT: adjust etc/msrv-badge.svg as well
2424 - run: make check-msrv-on-ci
2525 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
2626 # like it doesn't exist.
Cargo.lock+90−177
@@ -129,7 +129,7 @@ dependencies = [ · 128 unmodified lines
129129 "slab",
130130 "socket2",
131131 "waker-fn",
132− "windows-sys 0.42.0",
132+ "windows-sys",
133133 ]
134134
135135 [[package]]
@@ -189,9 +189,9 @@ checksum = "7a40729d2133846d9ed0ea60a8b9541bccddab49cd30f0715a1da672fe9a2524" · 53 unmodified lines
189189
190190 [[package]]
191191 name = "async-trait"
192−version = "0.1.60"
192+version = "0.1.61"
193193 source = "registry+https://github.com/rust-lang/crates.io-index"
194−checksum = "677d1d8ab452a3936018a687b20e6f7cf5363d713b732b8884001317b0e48aa3"
194+checksum = "705339e0e4a9690e2908d2b3d049d85682cf19fbd5782494498fbf7003a6a282"
195195 dependencies = [
196196 "proc-macro2",
197197 "quote",
@@ -236,6 +236,12 @@ version = "0.13.1" · 38 unmodified lines
236236 source = "registry+https://github.com/rust-lang/crates.io-index"
237237 checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"
238238
239+[[package]]
240+name = "base64"
241+version = "0.21.0"
242+source = "registry+https://github.com/rust-lang/crates.io-index"
243+checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a"
244+
239245 [[package]]
240246 name = "bitflags"
241247 version = "1.3.2"
@@ -315,9 +321,9 @@ dependencies = [ · 73 unmodified lines
315321
316322 [[package]]
317323 name = "camino"
318−version = "1.1.1"
324+version = "1.1.2"
319325 source = "registry+https://github.com/rust-lang/crates.io-index"
320−checksum = "88ad0e1e3e88dd237a156ab9f571021b8a158caa0ae44b1968a241efb5144c1e"
326+checksum = "c77df041dc383319cc661b428b6961a005db4d6808d5e12536931b1ca9556055"
321327 dependencies = [
322328 "serde",
323329 ]
@@ -341,7 +347,7 @@ dependencies = [ · 17 unmodified lines
341347 "cargo_toml",
342348 "clap",
343349 "crates-index",
344− "env_logger 0.9.3",
350+ "env_logger",
345351 "git-conventional",
346352 "git-repository",
347353 "git-testtools",
@@ -371,12 +377,11 @@ dependencies = [ · 23 unmodified lines
371377
372378 [[package]]
373379 name = "cargo_toml"
374−version = "0.11.8"
380+version = "0.14.0"
375381 source = "registry+https://github.com/rust-lang/crates.io-index"
376−checksum = "e72c3ff59e3b7d24630206bb63a73af65da4ed5df1f76ee84dfafb9fee2ba60e"
382+checksum = "0f1204fe51a1e56042b8ec31d6407547ecd18f596b66f470dadb9abd9be9c843"
377383 dependencies = [
378384 "serde",
379− "serde_derive",
380385 "toml",
381386 ]
382387
@@ -497,16 +502,6 @@ dependencies = [ · 114 unmodified lines
497502 "cc",
498503 ]
499504
500−[[package]]
501−name = "combine"
502−version = "4.6.6"
503−source = "registry+https://github.com/rust-lang/crates.io-index"
504−checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4"
505−dependencies = [
506− "bytes",
507− "memchr",
508−]
509−
510505 [[package]]
511506 name = "compact_str"
512507 version = "0.6.1"
@@ -539,14 +534,14 @@ dependencies = [ · 26 unmodified lines
539534
540535 [[package]]
541536 name = "console"
542−version = "0.15.3"
537+version = "0.15.4"
543538 source = "registry+https://github.com/rust-lang/crates.io-index"
544−checksum = "5556015fe3aad8b968e5d4124980fbe2f6aaee7aeec6b749de1faaa2ca5d0a4c"
539+checksum = "c9b6515d269224923b26b5febea2ed42b2d5f2ce37284a4dd670fedd6cb8347a"
545540 dependencies = [
546541 "encode_unicode",
547542 "lazy_static",
548543 "libc",
549− "windows-sys 0.42.0",
544+ "windows-sys",
550545 ]
551546
552547 [[package]]
@@ -923,18 +918,6 @@ dependencies = [ · 370 unmodified lines
923918 "syn",
924919 ]
925920
926−[[package]]
927−name = "env_logger"
928−version = "0.9.3"
929−source = "registry+https://github.com/rust-lang/crates.io-index"
930−checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7"
931−dependencies = [
932− "atty",
933− "humantime",
934− "log",
935− "termcolor",
936−]
937−
938921 [[package]]
939922 name = "env_logger"
940923 version = "0.10.0"
@@ -976,12 +959,12 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" · 35 unmodified lines
976959
977960 [[package]]
978961 name = "expectrl"
979−version = "0.5.2"
962+version = "0.6.0"
980963 source = "registry+https://github.com/rust-lang/crates.io-index"
981−checksum = "2795e11f4ee3124984d454f25ac899515a5fa6d956562ef2b147fef6050b02f8"
964+checksum = "1ae3a1de9c4a0cfc3badf6f98bf0736fe3f05e3b6da5b8f5288a4726fcc6f746"
982965 dependencies = [
983966 "conpty",
984− "nix 0.23.2",
967+ "nix 0.25.1",
985968 "ptyprocess",
986969 "regex",
987970 ]
@@ -1004,7 +987,7 @@ dependencies = [ · 16 unmodified lines
1004987 "cfg-if",
1005988 "libc",
1006989 "redox_syscall",
1007− "windows-sys 0.42.0",
990+ "windows-sys",
1008991 ]
1009992
1010993 [[package]]
@@ -1767,7 +1750,7 @@ dependencies = [ · 756 unmodified lines
17671750 "libc",
17681751 "serde",
17691752 "tempfile",
1770− "windows 0.40.0",
1753+ "windows 0.43.0",
17711754 ]
17721755
17731756 [[package]]
@@ -1823,7 +1806,7 @@ version = "0.25.2" · 49 unmodified lines
18231806 dependencies = [
18241807 "async-std",
18251808 "async-trait",
1826− "base64",
1809+ "base64 0.21.0",
18271810 "blocking",
18281811 "bstr",
18291812 "curl",
@@ -1930,7 +1913,7 @@ dependencies = [ · 100 unmodified lines
19301913 "clap",
19311914 "crosstermion",
19321915 "document-features",
1933− "env_logger 0.10.0",
1916+ "env_logger",
19341917 "futures-lite",
19351918 "git-features",
19361919 "git-repository",
@@ -2212,9 +2195,9 @@ dependencies = [ · 275 unmodified lines
22122195
22132196 [[package]]
22142197 name = "insta"
2215−version = "1.23.0"
2198+version = "1.26.0"
22162199 source = "registry+https://github.com/rust-lang/crates.io-index"
2217−checksum = "e48b08a091dfe5b09a6a9688c468fdd5b4396e92ce09e2eb932f0884b02788a4"
2200+checksum = "f6f0f08b46e4379744de2ab67aa8f7de3ffd1da3e275adc41fcc82053ede46ff"
22182201 dependencies = [
22192202 "console",
22202203 "lazy_static",
@@ -2249,7 +2232,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" · 28 unmodified lines
22492232 checksum = "46112a93252b123d31a119a8d1a1ac19deac4fac6e0e8b0df58f0d4e5870e63c"
22502233 dependencies = [
22512234 "libc",
2252− "windows-sys 0.42.0",
2235+ "windows-sys",
22532236 ]
22542237
22552238 [[package]]
@@ -2266,9 +2249,9 @@ dependencies = [ · 10 unmodified lines
22662249
22672250 [[package]]
22682251 name = "ipnet"
2269−version = "2.7.0"
2252+version = "2.7.1"
22702253 source = "registry+https://github.com/rust-lang/crates.io-index"
2271−checksum = "11b0d96e660696543b251e58030cf9787df56da39dab19ad60eae7353040917e"
2254+checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146"
22722255
22732256 [[package]]
22742257 name = "is-terminal"
@@ -2279,7 +2262,7 @@ dependencies = [ · 4 unmodified lines
22792262 "hermit-abi 0.2.6",
22802263 "io-lifetimes",
22812264 "rustix",
2282− "windows-sys 0.42.0",
2265+ "windows-sys",
22832266 ]
22842267
22852268 [[package]]
@@ -2548,7 +2531,7 @@ dependencies = [ · 262 unmodified lines
25482531 "libc",
25492532 "log",
25502533 "wasi",
2551− "windows-sys 0.42.0",
2534+ "windows-sys",
25522535 ]
25532536
25542537 [[package]]
@@ -2584,15 +2567,16 @@ dependencies = [ · 29 unmodified lines
25842567
25852568 [[package]]
25862569 name = "nix"
2587−version = "0.23.2"
2570+version = "0.25.1"
25882571 source = "registry+https://github.com/rust-lang/crates.io-index"
2589−checksum = "8f3790c00a0150112de0f4cd161e3d7fc4b2d8a5542ffc35f099a2562aecb35c"
2572+checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4"
25902573 dependencies = [
2574+ "autocfg",
25912575 "bitflags",
2592− "cc",
25932576 "cfg-if",
25942577 "libc",
25952578 "memoffset 0.6.5",
2579+ "pin-utils",
25962580 ]
25972581
25982582 [[package]]
@@ -2609,14 +2593,23 @@ dependencies = [ · 10 unmodified lines
26092593
26102594 [[package]]
26112595 name = "nom"
2612−version = "7.1.1"
2596+version = "7.1.2"
26132597 source = "registry+https://github.com/rust-lang/crates.io-index"
2614−checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36"
2598+checksum = "e5507769c4919c998e69e49c839d9dc6e693ede4cc4290d6ad8b41d4f09c548c"
26152599 dependencies = [
26162600 "memchr",
26172601 "minimal-lexical",
26182602 ]
26192603
2604+[[package]]
2605+name = "nom8"
2606+version = "0.2.0"
2607+source = "registry+https://github.com/rust-lang/crates.io-index"
2608+checksum = "ae01545c9c7fc4486ab7debaf2aad7003ac19431791868fb2e8066df97fad2f8"
2609+dependencies = [
2610+ "memchr",
2611+]
2612+
26202613 [[package]]
26212614 name = "num-traits"
26222615 version = "0.2.15"
@@ -2725,9 +2718,9 @@ checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" · 102 unmodified lines
27252718
27262719 [[package]]
27272720 name = "papergrid"
2728−version = "0.5.1"
2721+version = "0.7.1"
27292722 source = "registry+https://github.com/rust-lang/crates.io-index"
2730−checksum = "453cf71f2a37af495a1a124bf30d4d7469cfbea58e9f2479be9d222396a518a2"
2723+checksum = "1526bb6aa9f10ec339fb10360f22c57edf81d5678d0278e93bc12a47ffbe4b01"
27312724 dependencies = [
27322725 "bytecount",
27332726 "fnv",
@@ -2785,7 +2778,7 @@ dependencies = [ · 51 unmodified lines
27852778 "libc",
27862779 "redox_syscall",
27872780 "smallvec",
2788− "windows-sys 0.42.0",
2781+ "windows-sys",
27892782 ]
27902783
27912784 [[package]]
@@ -2851,7 +2844,7 @@ dependencies = [ · 59 unmodified lines
28512844 "libc",
28522845 "log",
28532846 "wepoll-ffi",
2854− "windows-sys 0.42.0",
2847+ "windows-sys",
28552848 ]
28562849
28572850 [[package]]
@@ -3046,9 +3039,9 @@ dependencies = [ · 188 unmodified lines
30463039
30473040 [[package]]
30483041 name = "regex"
3049−version = "1.7.0"
3042+version = "1.7.1"
30503043 source = "registry+https://github.com/rust-lang/crates.io-index"
3051−checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a"
3044+checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733"
30523045 dependencies = [
30533046 "aho-corasick",
30543047 "memchr",
@@ -3082,7 +3075,7 @@ version = "0.11.13" · 27 unmodified lines
30823075 source = "registry+https://github.com/rust-lang/crates.io-index"
30833076 checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c"
30843077 dependencies = [
3085− "base64",
3078+ "base64 0.13.1",
30863079 "bytes",
30873080 "encoding_rs",
30883081 "futures-core",
@@ -3161,7 +3154,7 @@ dependencies = [ · 72 unmodified lines
31613154 "io-lifetimes",
31623155 "libc",
31633156 "linux-raw-sys",
3164− "windows-sys 0.42.0",
3157+ "windows-sys",
31653158 ]
31663159
31673160 [[package]]
@@ -3182,7 +3175,7 @@ version = "1.0.1" · 14 unmodified lines
31823175 source = "registry+https://github.com/rust-lang/crates.io-index"
31833176 checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55"
31843177 dependencies = [
3185− "base64",
3178+ "base64 0.13.1",
31863179 ]
31873180
31883181 [[package]]
@@ -3208,12 +3201,11 @@ dependencies = [ · 19 unmodified lines
32083201
32093202 [[package]]
32103203 name = "schannel"
3211−version = "0.1.20"
3204+version = "0.1.21"
32123205 source = "registry+https://github.com/rust-lang/crates.io-index"
3213−checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2"
3206+checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3"
32143207 dependencies = [
3215− "lazy_static",
3216− "windows-sys 0.36.1",
3208+ "windows-sys",
32173209 ]
32183210
32193211 [[package]]
@@ -3309,9 +3301,9 @@ dependencies = [ · 89 unmodified lines
33093301
33103302 [[package]]
33113303 name = "serial_test"
3312−version = "0.9.0"
3304+version = "0.10.0"
33133305 source = "registry+https://github.com/rust-lang/crates.io-index"
3314−checksum = "92761393ee4dc3ff8f4af487bd58f4307c9329bbedea02cac0089ad9c411e153"
3306+checksum = "1c789ec87f4687d022a2405cf46e0cd6284889f1839de292cadeb6c6019506f2"
33153307 dependencies = [
33163308 "dashmap",
33173309 "futures",
@@ -3323,11 +3315,10 @@ dependencies = [ · 5 unmodified lines
33233315
33243316 [[package]]
33253317 name = "serial_test_derive"
3326−version = "0.9.0"
3318+version = "0.10.0"
33273319 source = "registry+https://github.com/rust-lang/crates.io-index"
3328−checksum = "4b6f5d1c3087fb119617cff2966fe3808a80e5eb59a8c1601d5994d66f4346a5"
3320+checksum = "b64f9e531ce97c88b4778aad0ceee079216071cffec6ac9b904277f8f92e7fe3"
33293321 dependencies = [
3330− "proc-macro-error",
33313322 "proc-macro2",
33323323 "quote",
33333324 "syn",
@@ -3473,9 +3464,9 @@ dependencies = [ · 139 unmodified lines
34733464
34743465 [[package]]
34753466 name = "tabled"
3476−version = "0.8.0"
3467+version = "0.10.0"
34773468 source = "registry+https://github.com/rust-lang/crates.io-index"
3478−checksum = "e5b2f8c37d26d87d2252187b0a45ea3cbf42baca10377c7e7eaaa2800fa9bf97"
3469+checksum = "56c3ee73732ffceaea7b8f6b719ce3bb17f253fa27461ffeaf568ebd0cdb4b85"
34793470 dependencies = [
34803471 "papergrid",
34813472 "unicode-width",
@@ -3596,9 +3587,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" · 114 unmodified lines
35963587
35973588 [[package]]
35983589 name = "tokio"
3599−version = "1.23.0"
3590+version = "1.24.1"
36003591 source = "registry+https://github.com/rust-lang/crates.io-index"
3601−checksum = "eab6d665857cc6ca78d6e80303a02cea7a7851e85dfbd77cbdc09bd129f1ef46"
3592+checksum = "1d9f76183f91ecfb55e1d7d5602bd1d979e38a3a522fe900241cf195624d67ae"
36023593 dependencies = [
36033594 "autocfg",
36043595 "bytes",
@@ -3608,7 +3599,7 @@ dependencies = [ · 3 unmodified lines
36083599 "num_cpus",
36093600 "pin-project-lite",
36103601 "socket2",
3611− "windows-sys 0.42.0",
3602+ "windows-sys",
36123603 ]
36133604
36143605 [[package]]
@@ -3655,15 +3646,22 @@ dependencies = [ · 40 unmodified lines
36553646 "serde",
36563647 ]
36573648
3649+[[package]]
3650+name = "toml_datetime"
3651+version = "0.5.0"
3652+source = "registry+https://github.com/rust-lang/crates.io-index"
3653+checksum = "808b51e57d0ef8f71115d8f3a01e7d3750d01c79cac4b3eda910f4389fdf92fd"
3654+
36583655 [[package]]
36593656 name = "toml_edit"
3660−version = "0.14.4"
3657+version = "0.17.1"
36613658 source = "registry+https://github.com/rust-lang/crates.io-index"
3662−checksum = "5376256e44f2443f8896ac012507c19a012df0fe8758b55246ae51a2279db51f"
3659+checksum = "a34cc558345efd7e88b9eda9626df2138b80bb46a7606f695e751c892bc7dac6"
36633660 dependencies = [
3664− "combine",
36653661 "indexmap",
36663662 "itertools",
3663+ "nom8",
3664+ "toml_datetime",
36673665 ]
36683666
36693667 [[package]]
@@ -3751,9 +3749,9 @@ dependencies = [ · 81 unmodified lines
37513749
37523750 [[package]]
37533751 name = "try-lock"
3754−version = "0.2.3"
3752+version = "0.2.4"
37553753 source = "registry+https://github.com/rust-lang/crates.io-index"
3756−checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642"
3754+checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed"
37573755
37583756 [[package]]
37593757 name = "tui"
@@ -4071,30 +4069,17 @@ dependencies = [ · 311 unmodified lines
40714069
40724070 [[package]]
40734071 name = "windows"
4074−version = "0.40.0"
4072+version = "0.43.0"
40754073 source = "registry+https://github.com/rust-lang/crates.io-index"
4076−checksum = "e30acc718a52fb130fec72b1cb5f55ffeeec9253e1b785e94db222178a6acaa1"
4074+checksum = "04662ed0e3e5630dfa9b26e4cb823b817f1a9addda855d973a9458c236556244"
40774075 dependencies = [
4078− "windows_aarch64_gnullvm 0.40.0",
4079− "windows_aarch64_msvc 0.40.0",
4080− "windows_i686_gnu 0.40.0",
4081− "windows_i686_msvc 0.40.0",
4082− "windows_x86_64_gnu 0.40.0",
4083− "windows_x86_64_gnullvm 0.40.0",
4084− "windows_x86_64_msvc 0.40.0",
4085−]
4086−
4087−[[package]]
4088−name = "windows-sys"
4089−version = "0.36.1"
4090−source = "registry+https://github.com/rust-lang/crates.io-index"
4091−checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2"
4092−dependencies = [
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",
4076+ "windows_aarch64_gnullvm",
4077+ "windows_aarch64_msvc 0.42.0",
4078+ "windows_i686_gnu 0.42.0",
4079+ "windows_i686_msvc 0.42.0",
4080+ "windows_x86_64_gnu 0.42.0",
4081+ "windows_x86_64_gnullvm",
4082+ "windows_x86_64_msvc 0.42.0",
40984083 ]
40994084
41004085 [[package]]
@@ -4103,21 +4088,15 @@ version = "0.42.0" · 2 unmodified lines
41034088 source = "registry+https://github.com/rust-lang/crates.io-index"
41044089 checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"
41054090 dependencies = [
4106− "windows_aarch64_gnullvm 0.42.0",
4091+ "windows_aarch64_gnullvm",
41074092 "windows_aarch64_msvc 0.42.0",
41084093 "windows_i686_gnu 0.42.0",
41094094 "windows_i686_msvc 0.42.0",
41104095 "windows_x86_64_gnu 0.42.0",
4111− "windows_x86_64_gnullvm 0.42.0",
4096+ "windows_x86_64_gnullvm",
41124097 "windows_x86_64_msvc 0.42.0",
41134098 ]
41144099
4115−[[package]]
4116−name = "windows_aarch64_gnullvm"
4117−version = "0.40.0"
4118−source = "registry+https://github.com/rust-lang/crates.io-index"
4119−checksum = "f3caa4a1a16561b714323ca6b0817403738583033a6a92e04c5d10d4ba37ca10"
4120−
41214100 [[package]]
41224101 name = "windows_aarch64_gnullvm"
41234102 version = "0.42.0"
@@ -4130,18 +4109,6 @@ version = "0.29.0" · 6 unmodified lines
41304109 source = "registry+https://github.com/rust-lang/crates.io-index"
41314110 checksum = "c3d027175d00b01e0cbeb97d6ab6ebe03b12330a35786cbaca5252b1c4bf5d9b"
41324111
4133−[[package]]
4134−name = "windows_aarch64_msvc"
4135−version = "0.36.1"
4136−source = "registry+https://github.com/rust-lang/crates.io-index"
4137−checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47"
4138−
4139−[[package]]
4140−name = "windows_aarch64_msvc"
4141−version = "0.40.0"
4142−source = "registry+https://github.com/rust-lang/crates.io-index"
4143−checksum = "328973c62dfcc50fb1aaa8e7100676e0b642fe56bac6bafff3327902db843ab4"
4144−
41454112 [[package]]
41464113 name = "windows_aarch64_msvc"
41474114 version = "0.42.0"
@@ -4154,18 +4121,6 @@ version = "0.29.0" · 6 unmodified lines
41544121 source = "registry+https://github.com/rust-lang/crates.io-index"
41554122 checksum = "8793f59f7b8e8b01eda1a652b2697d87b93097198ae85f823b969ca5b89bba58"
41564123
4157−[[package]]
4158−name = "windows_i686_gnu"
4159−version = "0.36.1"
4160−source = "registry+https://github.com/rust-lang/crates.io-index"
4161−checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6"
4162−
4163−[[package]]
4164−name = "windows_i686_gnu"
4165−version = "0.40.0"
4166−source = "registry+https://github.com/rust-lang/crates.io-index"
4167−checksum = "aa5b09fad70f0df85dea2ac2a525537e415e2bf63ee31cf9b8e263645ee9f3c1"
4168−
41694124 [[package]]
41704125 name = "windows_i686_gnu"
41714126 version = "0.42.0"
@@ -4178,18 +4133,6 @@ version = "0.29.0" · 6 unmodified lines
41784133 source = "registry+https://github.com/rust-lang/crates.io-index"
41794134 checksum = "8602f6c418b67024be2996c512f5f995de3ba417f4c75af68401ab8756796ae4"
41804135
4181−[[package]]
4182−name = "windows_i686_msvc"
4183−version = "0.36.1"
4184−source = "registry+https://github.com/rust-lang/crates.io-index"
4185−checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024"
4186−
4187−[[package]]
4188−name = "windows_i686_msvc"
4189−version = "0.40.0"
4190−source = "registry+https://github.com/rust-lang/crates.io-index"
4191−checksum = "2a1ad4031c1a98491fa195d8d43d7489cb749f135f2e5c4eed58da094bd0d876"
4192−
41934136 [[package]]
41944137 name = "windows_i686_msvc"
41954138 version = "0.42.0"
@@ -4202,30 +4145,12 @@ version = "0.29.0" · 6 unmodified lines
42024145 source = "registry+https://github.com/rust-lang/crates.io-index"
42034146 checksum = "f3d615f419543e0bd7d2b3323af0d86ff19cbc4f816e6453f36a2c2ce889c354"
42044147
4205−[[package]]
4206−name = "windows_x86_64_gnu"
4207−version = "0.36.1"
4208−source = "registry+https://github.com/rust-lang/crates.io-index"
4209−checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1"
4210−
4211−[[package]]
4212−name = "windows_x86_64_gnu"
4213−version = "0.40.0"
4214−source = "registry+https://github.com/rust-lang/crates.io-index"
4215−checksum = "520ff37edd72da8064b49d2281182898e17f0688ae9f4070bca27e4b5c162ac7"
4216−
42174148 [[package]]
42184149 name = "windows_x86_64_gnu"
42194150 version = "0.42.0"
42204151 source = "registry+https://github.com/rust-lang/crates.io-index"
42214152 checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed"
42224153
4223−[[package]]
4224−name = "windows_x86_64_gnullvm"
4225−version = "0.40.0"
4226−source = "registry+https://github.com/rust-lang/crates.io-index"
4227−checksum = "046e5b82215102c44fd75f488f1b9158973d02aa34d06ed85c23d6f5520a2853"
4228−
42294154 [[package]]
42304155 name = "windows_x86_64_gnullvm"
42314156 version = "0.42.0"
@@ -4238,18 +4163,6 @@ version = "0.29.0" · 6 unmodified lines
42384163 source = "registry+https://github.com/rust-lang/crates.io-index"
42394164 checksum = "11d95421d9ed3672c280884da53201a5c46b7b2765ca6faf34b0d71cf34a3561"
42404165
4241−[[package]]
4242−name = "windows_x86_64_msvc"
4243−version = "0.36.1"
4244−source = "registry+https://github.com/rust-lang/crates.io-index"
4245−checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680"
4246−
4247−[[package]]
4248−name = "windows_x86_64_msvc"
4249−version = "0.40.0"
4250−source = "registry+https://github.com/rust-lang/crates.io-index"
4251−checksum = "2a0c9c6df55dd1bfa76e131cef44bdd8ec9c819ef3611f04dfe453fd5bfeda28"
4252−
42534166 [[package]]
42544167 name = "windows_x86_64_msvc"
42554168 version = "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
9797
9898 # for progress
9999 owo-colors = "3.5.0"
100−tabled = { version = "0.8.0", default-features = false }
100+tabled = { version = "0.10.0", default-features = false }
101101
102102 document-features = { version = "0.2.0", optional = true }
103103
cargo-smart-release/Cargo.toml+3−3
@@ -27,13 +27,13 @@ cache-efficiency-debug = ["git-repository/cache-efficiency-debug"] · 26 unmodified lines
2727 git-repository = { version = "^0.32.0", path = "../git-repository", default-features = false, features = ["max-performance-safe"] }
2828 anyhow = "1.0.42"
2929 clap = { version = "3.2.5", features = ["derive", "cargo"] }
30−env_logger = { version = "0.9.0", default-features = false, features = ["humantime", "termcolor", "atty"] }
30+env_logger = { version = "0.10.0", default-features = false, features = ["humantime", "auto-color"] }
3131 cargo_metadata = "0.15.0"
3232 log = "0.4.14"
33−toml_edit = "0.14.0"
33+toml_edit = "0.17.1"
3434 semver = "1.0.4"
3535 crates-index = "0.18.9"
36−cargo_toml = "0.11.4"
36+cargo_toml = "0.14.0"
3737 nom = { version = "7", default-features = false, features = ["std"]}
3838 git-conventional = "0.12.0"
3939 time = "0.3.2"
cargo-smart-release/src/changelog/section/from_history.rs+2−1
@@ -133,7 +133,8 @@ impl Section { · 132 unmodified lines
133133
134134 let version = crate::git::try_strip_tag_path(segment.head.name.as_ref())
135135 .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());
137138 changelog::Version::Semantic(
138139 utils::parse_possibly_prefixed_tag_version(package_name, tag_name)
139140 .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
2020 no_links,
2121 ..
2222 } = opts;
23− let bump_spec = dependencies.then(|| BumpSpec::Auto).unwrap_or(BumpSpec::Keep);
23+ let bump_spec = if dependencies { BumpSpec::Auto } else { BumpSpec::Keep };
2424 let force_history_segmentation = false;
2525 let ctx = crate::Context::new(crates.clone(), force_history_segmentation, bump_spec, bump_spec)?;
2626 let crates: Vec<_> = {
@@ -41,9 +41,11 @@ pub fn changelog(opts: Options, crates: Vec<String>) -> anyhow::Result<()> { · 14 unmodified lines
4141 log::info!(
4242 "Skipping '{}' as it won't be published.{}",
4343 d.package.name,
44− (!dependencies)
45− .then(|| " Try not to specify --no-dependencies/--only.")
46− .unwrap_or("")
44+ if !dependencies {
45+ " Try not to specify --no-dependencies/--only."
46+ } else {
47+ ""
48+ }
4749 );
4850 }
4951 None
@@ -114,7 +116,7 @@ pub fn changelog(opts: Options, crates: Vec<String>) -> anyhow::Result<()> { · 64 unmodified lines
114116 if num_crates == 0 {
115117 anyhow::bail!(
116118 "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 { "" },
118120 ctx.crate_names
119121 .iter()
120122 .map(|c| format!("'{}'", c))
cargo-smart-release/src/command/release/manifest.rs+1−1
@@ -263,7 +263,7 @@ fn preview_changelogs( · 262 unmodified lines
263263 "use --no-changelog-preview to disable or Ctrl-C to abort, or the 'changelog' subcommand.";
264264 let changelogs_with_changes = pending_changelogs
265265 .iter()
266− .filter_map(|(_, has_changes, lock)| (*has_changes).then(|| lock))
266+ .filter_map(|(_, has_changes, lock)| (*has_changes).then_some(lock))
267267 .collect::<Vec<_>>();
268268 log::info!(
269269 "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
117117 .find_map(|(d, b)| {
118118 b.latest_release
119119 .as_ref()
120− .and_then(|lr| (lr >= &b.next_release).then(|| d))
120+ .and_then(|lr| (lr >= &b.next_release).then_some(d))
121121 })
122122 {
123123 let mut index = crate::crates_index::Index::new_cargo_default()?;
@@ -172,7 +172,7 @@ fn present_and_validate_dependencies( · 48 unmodified lines
172172
173173 let skipped = all_skipped
174174 .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)))
176176 .collect::<Vec<_>>();
177177 if !skipped.is_empty() {
178178 let skipped_len = skipped.len();
@@ -189,7 +189,7 @@ fn present_and_validate_dependencies( · 10 unmodified lines
189189 log::info!(
190190 "Will not publish or alter {} dependent crate{}: {}",
191191 skipped_len,
192− (skipped_len != 1).then(|| "s").unwrap_or(""),
192+ if skipped_len != 1 { "s" } else { "" },
193193 crates_by_reason
194194 .into_iter()
195195 .map(|(key, names)| format!(
@@ -225,7 +225,7 @@ fn present_and_validate_dependencies( · 29 unmodified lines
225225 if let Some(latest_release) = bump
226226 .latest_release
227227 .as_ref()
228− .and_then(|lr| (*lr >= bump.next_release).then(|| lr))
228+ .and_then(|lr| (*lr >= bump.next_release).then_some(lr))
229229 {
230230 let bump_flag = match dep.kind {
231231 dependency::Kind::UserSelection => "--bump <level>",
@@ -329,7 +329,7 @@ fn present_and_validate_dependencies( · 97 unmodified lines
329329 },
330330 );
331331 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 { "" };
333333 log::info!(
334334 "{} adjust {} manifest version{} due to breaking change in '{}': {}",
335335 will(dry_run),
@@ -361,7 +361,7 @@ fn present_and_validate_dependencies( · 25 unmodified lines
361361 .collect::<Vec<_>>();
362362 if !crate_names_for_manifest_updates.is_empty() {
363363 let plural_s = (crate_names_for_manifest_updates.len() > 1)
364− .then(|| "s")
364+ .then_some("s")
365365 .unwrap_or_default();
366366 log::info!(
367367 "{} 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
2222 .and_then(|p| {
2323 part_to_left
2424 .is_char_boundary(p + 1)
25− .then(|| p + 1)
25+ .then_some(p + 1)
2626 .or_else(|| part_to_left[p..].chars().next().map(|c| p + c.len_utf8()))
2727 })
2828 .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
4040 // KEEP THIS IN SYNC with git::create_ref_history()!
4141 .or_else(|| (ctx.meta.workspace_members.len() != 1).then(|| Utf8Path::new("src")))
4242 {
43− None => (current_commit != released_target).then(|| PackageChangeKind::ChangedOrNew),
43+ None => (current_commit != released_target).then_some(PackageChangeKind::ChangedOrNew),
4444 Some(dir) => {
4545 let components = dir.components().map(component_to_bytes);
4646 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
5858 .expect("path must exist as it was supposedly released there")
5959 .object_id();
6060
61− (released_dir_id != current_dir_id).then(|| PackageChangeKind::ChangedOrNew)
61+ (released_dir_id != current_dir_id).then_some(PackageChangeKind::ChangedOrNew)
6262 }
6363 }
6464 }
cargo-smart-release/src/traverse.rs+10−8
@@ -297,11 +297,11 @@ fn forward_propagate_breaking_changes_for_manifest_updates<'meta>( · 296 unmodified lines
297297 );
298298 }
299299 } else if is_pre_release_version(&dependant.version) || allow_auto_publish_of_stable_crates {
300− let kind = ctx
301− .crate_names
302− .contains(&dependant.name)
303− .then(|| dependency::Kind::UserSelection)
304− .unwrap_or(dependency::Kind::DependencyOrDependentOfUserSelection);
300+ let kind = if ctx.crate_names.contains(&dependant.name) {
301+ dependency::Kind::UserSelection
302+ } else {
303+ dependency::Kind::DependencyOrDependentOfUserSelection
304+ };
305305 let adjustment = dependency::VersionAdjustment::Breakage {
306306 bump,
307307 change: None,
@@ -448,9 +448,11 @@ impl EditForPublish { · 140 unmodified lines
448448 }
449449
450450 fn breaking_version_bump(ctx: &Context, package: &Package, bump_when_needed: bool) -> anyhow::Result<Bump> {
451− let breaking_spec = is_pre_release_version(&package.version)
452− .then(|| BumpSpec::Minor)
453− .unwrap_or(BumpSpec::Major);
451+ let breaking_spec = if is_pre_release_version(&package.version) {
452+ BumpSpec::Minor
453+ } else {
454+ BumpSpec::Major
455+ };
454456 version::bump_package_with_spec(package, breaking_spec, ctx, bump_when_needed)
455457 }
456458
clippy.toml+1−1
@@ -1 +1 @@
1−msrv = "1.60.0"
1+msrv = "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
7878 Value::MacroAttributes(into_owned_assignments(assignments).ok()?),
7979 ),
8080 crate::parse::Kind::Pattern(p) => (
81− (!p.is_negative()).then(|| p)?,
81+ (!p.is_negative()).then_some(p)?,
8282 Value::Assignments(into_owned_assignments(assignments).ok()?),
8383 ),
8484 };
@@ -278,7 +278,7 @@ where · 193 unmodified lines
278278 }| {
279279 pattern
280280 .matches_repo_relative_path(relative_path, basename_start_pos, is_dir, case)
281− .then(|| Match {
281+ .then_some(Match {
282282 pattern,
283283 value,
284284 source: self.source.as_deref(),
@@ -307,7 +307,7 @@ where · 22 unmodified lines
307307 .find_map(|(idx, pm)| {
308308 pm.pattern
309309 .matches_repo_relative_path(relative_path, basename_start_pos, is_dir, case)
310− .then(|| idx)
310+ .then_some(idx)
311311 })
312312 }
313313
@@ -321,7 +321,7 @@ where · 7 unmodified lines
321321 relative_path.strip_prefix(base.as_slice())?.as_bstr(),
322322 basename_pos.and_then(|pos| {
323323 let pos = pos - base.len();
324− (pos != 0).then(|| pos)
324+ (pos != 0).then_some(pos)
325325 }),
326326 ),
327327 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
3636 [dev-dependencies]
3737 git-testtools = { path = "../tests/tools"}
3838 git-repository = { path = "../git-repository" }
39−serial_test = "0.9.0"
39+serial_test = "0.10.0"
4040 serde_derive = "1.0"
4141 criterion = "0.4.0"
4242 tempfile = "3.2.0"
git-config/src/file/access/mutate.rs+1−0
@@ -348,6 +348,7 @@ impl<'event> File<'event> { · 347 unmodified lines
348348 }
349349 lhs.extend(rhs);
350350 }
351+ #[allow(clippy::unnecessary_lazy_evaluations)]
351352 let our_last_section_before_append =
352353 insert_after.or_else(|| (self.section_id_counter != 0).then(|| SectionId(self.section_id_counter - 1)));
353354
git-config/src/file/access/read_only.rs+2−2
@@ -166,7 +166,7 @@ impl<'event> File<'event> { · 165 unmodified lines
166166 let sections = &self.sections;
167167 move |id| {
168168 let s = &sections[&id];
169− filter(s.meta()).then(|| s)
169+ filter(s.meta()).then_some(s)
170170 }
171171 }))
172172 }
@@ -258,7 +258,7 @@ impl<'event> File<'event> { · 85 unmodified lines
258258 .sections
259259 .get(&id)
260260 .expect("section doesn't have id from from lookup");
261− filter(s.meta()).then(|| s)
261+ filter(s.meta()).then_some(s)
262262 })
263263 })
264264 }
git-config/src/file/includes/mod.rs+1−1
@@ -189,7 +189,7 @@ fn onbranch_matches( · 188 unmodified lines
189189 branch_name,
190190 git_glob::wildmatch::Mode::NO_MATCH_SLASH_LITERAL,
191191 )
192− .then(|| ())
192+ .then_some(())
193193 }
194194
195195 fn gitdir_matches(
git-config/src/file/init/comfort.rs+1−1
@@ -31,7 +31,7 @@ impl File<'static> { · 30 unmodified lines
3131 .filter_map(|source| {
3232 let path = source
3333 .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))
3535 .map(|p| p.into_owned());
3636
3737 Metadata {
git-config/src/file/mutable/section.rs+1−1
@@ -71,7 +71,7 @@ impl<'a, 'event> SectionMut<'a, 'event> { · 70 unmodified lines
7171 if !bytes.peek().map_or(true, |b| b.is_ascii_whitespace()) {
7272 c.insert(0, b' ');
7373 }
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 }));
7575 c.into()
7676 }),
7777 }));
git-config/src/file/section/body.rs+1−1
@@ -153,7 +153,7 @@ impl<'event> Body<'event> { · 152 unmodified lines
153153 // is included in the range
154154 let value_range = value_range.start..value_range.end + 1;
155155 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))
157157 })
158158 }
159159 }
git-config/src/file/util.rs+1−1
@@ -61,7 +61,7 @@ impl<'event> File<'event> { · 60 unmodified lines
6161 section_order
6262 .iter()
6363 .enumerate()
64− .find_map(|(idx, id)| (*id == section_id).then(|| idx))
64+ .find_map(|(idx, id)| (*id == section_id).then_some(idx))
6565 .expect("before-section exists")
6666 }
6767 };
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
6363 e.iter()
6464 .rev()
6565 .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))
6767 .unwrap_or(false)
6868 }
6969
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
400400 .iter()
401401 .enumerate()
402402 .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))
404404 .unwrap_or(0);
405405 (
406406 &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
4848
4949 fn validated_subsection(name: Cow<'_, BStr>) -> Result<Cow<'_, BStr>, Error> {
5050 is_valid_subsection(name.as_ref())
51− .then(|| name)
51+ .then_some(name)
5252 .ok_or(Error::InvalidSubSection)
5353 }
5454
5555 fn validated_name(name: Cow<'_, BStr>) -> Result<Cow<'_, BStr>, Error> {
5656 name.iter()
5757 .all(|b| b.is_ascii_alphanumeric() || *b == b'-')
58− .then(|| name)
58+ .then_some(name)
5959 .ok_or(Error::InvalidName)
6060 }
6161
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
142142 fn git_init(path: impl AsRef<std::path::Path>, bare: bool) -> crate::Result<git::Repository> {
143143 Ok(git::ThreadSafeRepository::init_opts(
144144 path,
145− bare.then(|| git::create::Kind::Bare)
146− .unwrap_or(git::create::Kind::WithWorktree),
145+ if bare {
146+ git::create::Kind::Bare
147+ } else {
148+ git::create::Kind::WithWorktree
149+ },
147150 git::create::Options::default(),
148151 git::open::Options::isolated().config_overrides(["user.name=gitoxide", "user.email=gitoxide@localhost"]),
149152 )?
git-date/tests/time/baseline.rs+1−1
@@ -29,7 +29,7 @@ static BASELINE: Lazy<HashMap<String, Sample>> = Lazy::new(|| { · 28 unmodified lines
2929 map.insert(
3030 date_str.into(),
3131 Sample {
32− format_name: (!format_name.is_empty()).then(|| format_name),
32+ format_name: (!format_name.is_empty()).then_some(format_name),
3333 exit_code,
3434 time_in_seconds_since_unix_epoch,
3535 },
git-discover/Cargo.toml+1−1
@@ -22,7 +22,7 @@ thiserror = "1.0.26" · 21 unmodified lines
2222
2323 [dev-dependencies]
2424 git-testtools = { path = "../tests/tools" }
25−serial_test = "0.9.0"
25+serial_test = "0.10.0"
2626 is_ci = "1.1.1"
2727
2828 [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
6060
6161 let filter_by_trust = |x: &Path| -> Result<Option<Trust>, Error> {
6262 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))
6464 };
6565
6666 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
5858 break;
5959 }
6060 }
61− (!res.is_empty()).then(|| res)
61+ (!res.is_empty()).then_some(res)
6262 }
6363 }
6464 }
git-features/src/parallel/in_parallel.rs+1−1
@@ -165,7 +165,7 @@ where · 164 unmodified lines
165165 let mut state = new_thread_state(thread_id);
166166 while let Ok(input_index) =
167167 index.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |x| {
168− (x < input_len).then(|| x + 1)
168+ (x < input_len).then_some(x + 1)
169169 })
170170 {
171171 if stop_everything.load(Ordering::Relaxed) {
git-glob/src/wildmatch.rs+1−4
@@ -72,10 +72,7 @@ pub(crate) mod function { · 71 unmodified lines
7272 }
7373 }
7474 STAR => {
75− let mut match_slash = mode
76− .contains(Mode::NO_MATCH_SLASH_LITERAL)
77− .then(|| false)
78− .unwrap_or(true);
75+ let mut match_slash = !mode.contains(Mode::NO_MATCH_SLASH_LITERAL);
7976 match p.next() {
8077 Some((next_p_idx, next_p_ch)) => {
8178 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
3838
3939 pub fn find(extensions: &[u8], object_hash: git_hash::Kind) -> Option<Vec<Offset>> {
4040 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))
4242 .and_then(decode)
4343 }
git-index/src/extension/tree/verify.rs+1−1
@@ -119,7 +119,7 @@ impl Tree { · 118 unmodified lines
119119 }
120120
121121 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)?;
123123 if let Some((actual, num_entries)) = declared_entries.zip(self.num_entries) {
124124 if actual > num_entries {
125125 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
5858
5959 let mut res = UntrackedCache {
6060 identifier: identifier.into(),
61− info_exclude: (!info_exclude.id.is_null()).then(|| info_exclude),
62− excludes_file: (!excludes_file.id.is_null()).then(|| excludes_file),
61+ info_exclude: (!info_exclude.id.is_null()).then_some(info_exclude),
62+ excludes_file: (!excludes_file.id.is_null()).then_some(excludes_file),
6363 exclude_filename_per_dir: exclude_filename_per_dir.into(),
6464 dir_flags,
6565 directories: Vec::new(),
6666 };
6767 if num_directory_blocks == 0 {
68− return data.is_empty().then(|| res);
68+ return data.is_empty().then_some(res);
6969 }
7070
7171 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
3333 &mut git_features::progress::Discard,
3434 &should_interrupt,
3535 )?;
36− (actual == checksum).then(|| ()).ok_or(Error::ChecksumMismatch {
36+ (actual == checksum).then_some(()).ok_or(Error::ChecksumMismatch {
3737 actual,
3838 expected: checksum,
3939 })
git-index/src/write.rs+1−1
@@ -132,7 +132,7 @@ impl State { · 131 unmodified lines
132132 fn detect_required_version(&self) -> Version {
133133 self.entries
134134 .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))
136136 .unwrap_or(Version::V2)
137137 }
138138 }
git-mailmap/src/parse.rs+1−1
@@ -110,7 +110,7 @@ fn parse_name_and_email( · 109 unmodified lines
110110 }
111111 let name = line[..start_bracket].trim().as_bstr();
112112 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))
114114 }
115115 None => Ok((None, None, line)),
116116 }
git-mailmap/src/snapshot/signature.rs+1−1
@@ -51,7 +51,7 @@ impl<'a> ResolvedSignature<'a> { · 50 unmodified lines
5151 ) -> Option<Self> {
5252 let new_email = new_email
5353 .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));
5555 match (new_email, new_name) {
5656 (None, None) => None,
5757 (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
4444 required_pack_index,
4545 } => index.lookup(id).and_then(|entry_index| {
4646 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)
4848 }),
4949 }
5050 }
@@ -90,7 +90,7 @@ pub(crate) mod index_lookup { · 39 unmodified lines
9090 "BUG: multi-pack index must be set if this is a multi-pack, pack-indices seem unstable",
9191 );
9292 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 {
9494 oid: e.oid,
9595 pack_offset: e.pack_offset,
9696 crc32: None,
git-odb/src/store_impls/dynamic/load_index.rs+4−4
@@ -111,7 +111,7 @@ impl super::Store { · 110 unmodified lines
111111 match index
112112 .next_index_to_load
113113 .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)
115115 }) {
116116 Ok(slot_map_index) => {
117117 // This slot-map index is in bounds and was only given to us.
@@ -230,7 +230,7 @@ impl super::Store { · 112 unmodified lines
230230 let indices_by_modification_time = Self::collect_indices_and_mtime_sorted_by_size(
231231 db_paths,
232232 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),
234234 )?;
235235 let mut idx_by_index_path: BTreeMap<_, _> = index
236236 .slot_indices
@@ -479,7 +479,7 @@ impl super::Store { · 242 unmodified lines
479479 (path != multi_index.path()
480480 && !index_names_in_multi_index
481481 .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))
483483 })
484484 .collect();
485485 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
488488 indices_by_modification_time.extend(
489489 indices
490490 .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))),
492492 )
493493 }
494494 }
git-pack/src/data/input/lookup_ref_delta_objects.rs+2−1
@@ -155,7 +155,8 @@ where · 154 unmodified lines
155155 self.inserted_entry_length_at_offset
156156 .get(maybe_index_of_actual_entry)
157157 .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)
159160 })
160161 .unwrap_or(index)
161162 };
git-pack/src/data/output/entry/iter_from_counts.rs+1−1
@@ -178,7 +178,7 @@ where · 177 unmodified lines
178178 count,
179179 counts_in_pack,
180180 base_index_offset,
181− allow_thin_pack.then(|| {
181+ allow_thin_pack.then_some({
182182 |pack_id, base_offset| {
183183 let (cached_pack_id, cache) = pack_offsets_to_id.get_or_insert_with(|| {
184184 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
244244 }
245245 }
246246
247− needs_large_offsets.then(|| num_large_offsets)
247+ needs_large_offsets.then_some(num_large_offsets)
248248 }
249249 /// Returns true if the `offsets` range seems to be properly aligned for the data we expect.
250250 pub fn is_valid(offset: &Range<usize>) -> bool {
@@ -258,7 +258,7 @@ pub mod large_offsets { · 7 unmodified lines
258258 ) -> std::io::Result<()> {
259259 for offset in sorted_entries
260260 .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))
262262 {
263263 out.write_all(&offset.to_be_bytes())?;
264264 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
104104
105105 let lookup = chunks.validated_usize_offset_by_id(chunk::lookup::ID, |offset| {
106106 chunk::lookup::is_valid(&offset, object_hash, num_objects)
107− .then(|| offset)
107+ .then_some(offset)
108108 .ok_or(Error::InvalidChunkSize {
109109 id: chunk::lookup::ID,
110110 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
112112 })??;
113113 let offsets = chunks.validated_usize_offset_by_id(chunk::offsets::ID, |offset| {
114114 chunk::offsets::is_valid(&offset, num_objects)
115− .then(|| offset)
115+ .then_some(offset)
116116 .ok_or(Error::InvalidChunkSize {
117117 id: chunk::offsets::ID,
118118 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
121121 let large_offsets = chunks
122122 .validated_usize_offset_by_id(chunk::large_offsets::ID, |offset| {
123123 chunk::large_offsets::is_valid(&offset)
124− .then(|| offset)
124+ .then_some(offset)
125125 .ok_or(Error::InvalidChunkSize {
126126 id: chunk::large_offsets::ID,
127127 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
2222 pub fn fan(data: &[u32]) -> Option<usize> {
2323 data.windows(2)
2424 .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))
2626 }
2727
2828 /// 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
2323
2424 [dev-dependencies]
2525 git-testtools = { path = "../tests/tools"}
26−serial_test = "0.9.0"
27−expectrl = "0.5.2"
26+serial_test = "0.10.0"
27+expectrl = "0.6.0"
git-prompt/src/types.rs+1−1
@@ -75,7 +75,7 @@ impl Options<'_> { · 74 unmodified lines
7575 .then(|| {
7676 std::env::var_os("GIT_TERMINAL_PROMPT")
7777 .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))
7979 })
8080 .flatten()
8181 .unwrap_or(self.mode);
git-protocol/tests/fetch/response.rs+1−1
@@ -127,7 +127,7 @@ mod v2 { · 126 unmodified lines
127127 for keepalive in [false, true] {
128128 let fixture = format!(
129129 "v2/clone-only{}.response",
130− keepalive.then(|| "-with-keepalive").unwrap_or_default()
130+ keepalive.then_some("-with-keepalive").unwrap_or_default()
131131 );
132132 let mut provider = mock_reader(&fixture);
133133 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
1212 let mut dlg = CloneDelegate::default();
1313 let fixture = format!(
1414 "v1/clone{}.response",
15− with_keepalive.then(|| "-with-keepalive").unwrap_or_default()
15+ with_keepalive.then_some("-with-keepalive").unwrap_or_default()
1616 );
1717 git_protocol::fetch(
1818 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
417417 MainRef | LinkedRef { .. } => sn
418418 .category()
419419 .map_or(false, |cat| !cat.is_worktree_private())
420− .then(|| sn),
420+ .then_some(sn),
421421 }
422422 .map(|n| n.to_owned())
423423 }
git-refspec/src/match_group/mod.rs+1−1
@@ -78,7 +78,7 @@ impl<'a> MatchGroup<'a> { · 77 unmodified lines
7878 for matcher in matchers
7979 .into_iter()
8080 .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)))
8282 {
8383 out.retain(|m| match m.lhs {
8484 SourceRef::ObjectId(_) => true,
git-refspec/src/match_group/util.rs+1−1
@@ -70,7 +70,7 @@ impl<'a> Needle<'a> { · 69 unmodified lines
7070 }
7171 }
7272 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)
7474 })
7575 .unwrap_or(Match::None),
7676 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
7272 f,
7373 "Found {} {} the refspec mapping to be used: \n\t{}",
7474 self.issues.len(),
75− (self.issues.len() == 1)
76− .then(|| "issue that prevents")
77− .unwrap_or("issues that prevent"),
75+ if self.issues.len() == 1 {
76+ "issue that prevents"
77+ } else {
78+ "issues that prevent"
79+ },
7880 self.issues
7981 .iter()
8082 .map(|issue| issue.to_string())
git-refspec/src/parse.rs+1−1
@@ -107,7 +107,7 @@ pub(crate) mod function { · 106 unmodified lines
107107 }
108108 }
109109 None => {
110− let src = (!spec.is_empty()).then(|| spec);
110+ let src = (!spec.is_empty()).then_some(spec);
111111 if Operation::Fetch == operation && mode != Mode::Negative && src.is_none() {
112112 return Ok(fetch_head_only(mode));
113113 } else {
git-refspec/src/spec.rs+1−1
@@ -140,7 +140,7 @@ impl<'a> RefSpecRef<'a> { · 139 unmodified lines
140140 let suffix = source.strip_prefix(b"refs/")?;
141141 let slash_pos = suffix.find_byte(b'/')?;
142142 let prefix = source[..="refs/".len() + slash_pos].as_bstr();
143− (!prefix.contains(&b'*')).then(|| prefix)
143+ (!prefix.contains(&b'*')).then_some(prefix)
144144 }
145145
146146 /// 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
77 authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
88 edition = "2021"
99 include = ["src/**/*", "CHANGELOG.md"]
10−rust-version = "1.60"
10+rust-version = "1.64"
1111
1212 [lib]
1313 doctest = false
@@ -151,7 +151,7 @@ git-testtools = { path = "../tests/tools" } · 137 unmodified lines
151151 is_ci = "1.1.1"
152152 anyhow = "1"
153153 walkdir = "2.3.2"
154−serial_test = "0.9.0"
154+serial_test = "0.10.0"
155155 async-std = { version = "1.12.0", features = ["attributes"] }
156156
157157 [package.metadata.docs.rs]
git-repository/src/config/cache/incubate.rs+1−1
@@ -37,7 +37,7 @@ impl StageOne { · 36 unmodified lines
3737 .value::<git_config::Integer>("core", None, "repositoryFormatVersion")
3838 .map_or(0, |v| v.to_decimal().unwrap_or_default());
3939 let object_hash = (repo_format_version != 1)
40− .then(|| Ok(git_hash::Kind::Sha1))
40+ .then_some(Ok(git_hash::Kind::Sha1))
4141 .or_else(|| {
4242 config.string("extensions", None, "objectFormat").map(|format| {
4343 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
4646 .boolean("core", None, "logAllRefUpdates")
4747 .and_then(|b| b.ok())
4848 .map(|b| {
49− b.then(|| git_ref::store::WriteReflog::Normal)
50− .unwrap_or(git_ref::store::WriteReflog::Disable)
49+ if b {
50+ git_ref::store::WriteReflog::Normal
51+ } else {
52+ git_ref::store::WriteReflog::Disable
53+ }
5154 }) {
5255 Some(val) => Ok(Some(val)),
5356 None => match config.string("core", None, "logAllRefUpdates") {
@@ -97,10 +100,10 @@ pub(crate) fn reflog_or_default( · 43 unmodified lines
97100 config_reflog: Option<git_ref::store::WriteReflog>,
98101 has_worktree: bool,
99102 ) -> git_ref::store::WriteReflog {
100− config_reflog.unwrap_or_else(|| {
101− has_worktree
102− .then(|| git_ref::store::WriteReflog::Normal)
103− .unwrap_or(git_ref::store::WriteReflog::Disable)
103+ config_reflog.unwrap_or(if has_worktree {
104+ git_ref::store::WriteReflog::Normal
105+ } else {
106+ git_ref::store::WriteReflog::Disable
104107 })
105108 }
106109
git-repository/src/config/snapshot/credential_helpers.rs+3−2
@@ -73,7 +73,7 @@ impl Snapshot<'_> { · 72 unmodified lines
7373 let ports = is_http
7474 .then(|| (pattern.port_or_default(), url.port_or_default()))
7575 .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);
7777
7878 if !path.map_or(true, |path| path == &url.path) {
7979 return None;
@@ -81,7 +81,8 @@ impl Snapshot<'_> { · 1 unmodified line
8181 if pattern.user().is_some() && pattern.user() != url.user() {
8282 return None;
8383 }
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)
8586 }),
8687 None => Some(section),
8788 };
git-repository/src/create.rs+5−2
@@ -229,8 +229,11 @@ pub fn into( · 228 unmodified lines
229229
230230 Ok(git_discover::repository::Path::from_dot_git_dir(
231231 dot_git,
232− bare.then(|| git_discover::repository::Kind::Bare)
233− .unwrap_or(git_discover::repository::Kind::WorkTree { linked_git_dir: None }),
232+ if bare {
233+ git_discover::repository::Kind::Bare
234+ } else {
235+ git_discover::repository::Kind::WorkTree { linked_git_dir: None }
236+ },
234237 std::env::current_dir()?,
235238 )
236239 .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
171171 ///
172172 /// This works by not actually fetching the pack after negotiating it, nor will refs be updated.
173173 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 };
175175 self
176176 }
177177
@@ -180,7 +180,11 @@ where · 2 unmodified lines
180180 /// This improves performance and allows case-sensitive filesystems to deal with ref names that would otherwise
181181 /// collide.
182182 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+ };
184188 self
185189 }
186190
git-repository/src/remote/save.rs+1−1
@@ -45,7 +45,7 @@ impl Remote<'_> { · 44 unmodified lines
4545 .to_owned(),
4646 })?;
4747 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))
4949 .collect::<Vec<_>>()
5050 }) {
5151 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
7070 None
7171 } else {
7272 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)
7474 }
7575 }
7676
git-repository/src/repository/config/transport.rs+5−2
@@ -235,8 +235,11 @@ impl crate::Repository { · 234 unmodified lines
235235 .transpose()
236236 .with_leniency(lenient)?
237237 {
238− val.then(|| http::options::FollowRedirects::All)
239− .unwrap_or(http::options::FollowRedirects::None)
238+ if val {
239+ http::options::FollowRedirects::All
240+ } else {
241+ http::options::FollowRedirects::None
242+ }
240243 } else {
241244 http::options::FollowRedirects::Initial
242245 };
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
116116 self.follow_refs_to_objects_if_needed();
117117 self.disambiguate_objects_by_fallback_hint(
118118 self.kind_implies_committish()
119− .then(|| ObjectKindHint::Committish)
119+ .then_some(ObjectKindHint::Committish)
120120 .or(self.opts.object_kind_hint),
121121 );
122122 }
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
6363 let candidate = git_path::os_str_into_bstr(git_dir.file_name().expect("at least one directory level"))
6464 .expect("no illformed UTF-8");
6565 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)
6767 }
6868
6969 ///
@@ -130,7 +130,7 @@ pub mod excludes { · 60 unmodified lines
130130 let case = repo
131131 .config
132132 .ignore_case
133− .then(|| git_glob::pattern::Case::Fold)
133+ .then_some(git_glob::pattern::Case::Fold)
134134 .unwrap_or_default();
135135 let mut buf = Vec::with_capacity(512);
136136 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
4545 .max_depth(2)
4646 .follow_links(false)
4747 .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)))
4949 {
5050 let map = baseline_map
5151 .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
206206 rest.iter().all(|b| b.is_ascii_hexdigit()).then(|| rest.as_bstr())
207207 })?;
208208
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);
210210 let hint = iter
211211 .next()
212212 .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
235235 let candidate = iter
236236 .next()
237237 .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()
239239 }
240240
241241 type InsideParensRestConsumed<'a> = (std::borrow::Cow<'a, BStr>, &'a BStr, usize);
@@ -388,7 +388,7 @@ where · 146 unmodified lines
388388 try_set_prefix(delegate, prefix, hint)
389389 })
390390 .or_else(|| {
391− name.is_empty().then(|| ()).or_else(|| {
391+ name.is_empty().then_some(()).or_else(|| {
392392 #[allow(clippy::let_unit_value)]
393393 {
394394 let res = delegate.find_ref(name)?;
git-sec/Cargo.toml+1−1
@@ -27,7 +27,7 @@ libc = "0.2.123" · 26 unmodified lines
2727 [target.'cfg(windows)'.dependencies]
2828 git-path = { version = "^0.7.0", path = "../git-path" }
2929 dirs = "4"
30−windows = { version = "0.40.0", features = [
30+windows = { version = "0.43.0", features = [
3131 "Win32_Foundation",
3232 "Win32_Security_Authorization",
3333 "Win32_Storage_FileSystem",
git-sec/src/identity.rs+10−2
@@ -119,10 +119,18 @@ mod impl_ { · 118 unmodified lines
119119
120120 let mut buffer_size = 0;
121121 let mut buffer = Vec::<u8>::new();
122− GetTokenInformation(token, TokenOwner, None, &mut buffer_size);
122+ GetTokenInformation(token, TokenOwner, None, 0, &mut buffer_size);
123123 if buffer_size != 0 {
124124 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+ {
126134 let token_owner = buffer.as_ptr() as *const TOKEN_OWNER;
127135 let token_owner = (*token_owner).Owner;
128136
git-sec/src/trust.rs+5−3
@@ -3,9 +3,11 @@ use crate::Trust; · 2 unmodified lines
33 impl Trust {
44 /// Derive `Full` trust if `path` is owned by the user executing the current process, or `Reduced` trust otherwise.
55 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())?
7− .then(|| Trust::Full)
8− .unwrap_or(Trust::Reduced))
6+ Ok(if crate::identity::is_path_owned_by_current_user(path.as_ref())? {
7+ Trust::Full
8+ } else {
9+ Trust::Reduced
10+ })
911 }
1012 }
1113
git-tempfile/src/fs/remove_dir.rs+1−1
@@ -51,7 +51,7 @@ impl<'a> Iterator for Iter<'a> { · 50 unmodified lines
5151 },
5252 };
5353 self.cursor = match dir.parent() {
54− Some(parent) => (parent != self.boundary).then(|| parent),
54+ Some(parent) => (parent != self.boundary).then_some(parent),
5555 None => {
5656 unreachable!("directory {:?} ran out of parents, this really shouldn't happen before hitting the boundary {:?}", dir, self.boundary)
5757 }
git-transport/Cargo.toml+1−1
@@ -70,7 +70,7 @@ futures-lite = { version = "1.12.0", optional = true } · 69 unmodified lines
7070 pin-project-lite = { version = "0.2.6", optional = true }
7171
7272 # for http-client
73−base64 = { version = "0.13.0", optional = true }
73+base64 = { version = "0.21.0", optional = true }
7474
7575 # for http-client-curl. Additional configuration should be performed on higher levels of the dependency tree.
7676 curl = { 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
9191 fn set_identity(&mut self, identity: git_sec::identity::Account) -> Result<(), client::Error> {
9292 if self.url.scheme == git_url::Scheme::Ssh {
9393 self.url
94− .set_user((!identity.username.is_empty()).then(|| identity.username));
94+ .set_user((!identity.username.is_empty()).then_some(identity.username));
9595 Ok(())
9696 } else {
9797 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
308308 authenticate.lock().expect("no panics in other threads")(action.erase()).ok();
309309 }
310310 let err = Err(io::Error::new(
311− curl_is_spurious(&err)
312− .then(|| std::io::ErrorKind::ConnectionReset)
313− .unwrap_or(std::io::ErrorKind::Other),
311+ if curl_is_spurious(&err) {
312+ std::io::ErrorKind::ConnectionReset
313+ } else {
314+ std::io::ErrorKind::Other
315+ },
314316 err,
315317 ));
316318 handler.receive_body.take();
git-transport/src/client/blocking_io/http/mod.rs+3−2
@@ -1,3 +1,4 @@
1+use base64::Engine;
12 use std::{
23 any::Any,
34 borrow::Cow,
@@ -8,7 +9,7 @@ use std::{ · 4 unmodified lines
89
910 use bstr::BStr;
1011 use git_packetline::PacketLineRef;
11−pub use traits::{Error, GetResponse, Http, PostResponse};
12+pub use traits::{Error, GetResponse, Http, PostBodyDataKind, PostResponse};
1213
1314 use crate::{
1415 client::{
@@ -269,7 +270,7 @@ impl<H: Http> Transport<H> { · 254 unmodified lines
269270 }
270271 headers.push(Cow::Owned(format!(
271272 "Authorization: Basic {}",
272− base64::encode(format!("{}:{}", username, password))
273+ base64::engine::general_purpose::STANDARD.encode(format!("{}:{}", username, password))
273274 )))
274275 }
275276 Ok(())
git-transport/src/client/blocking_io/ssh/mod.rs+6−3
@@ -97,7 +97,7 @@ pub fn connect( · 96 unmodified lines
9797 let ssh_cmd = options.ssh_command();
9898 let mut kind = options.kind.unwrap_or_else(|| ProgramKind::from(ssh_cmd));
9999 if options.kind.is_none() && kind == ProgramKind::Simple {
100− kind = std::process::Command::from(
100+ kind = if std::process::Command::from(
101101 git_command::prepare(ssh_cmd)
102102 .stderr(Stdio::null())
103103 .stdout(Stdio::null())
@@ -109,8 +109,11 @@ pub fn connect( · 5 unmodified lines
109109 .status()
110110 .ok()
111111 .map_or(false, |status| status.success())
112− .then(|| ProgramKind::Ssh)
113− .unwrap_or(ProgramKind::Simple);
112+ {
113+ ProgramKind::Ssh
114+ } else {
115+ ProgramKind::Simple
116+ };
114117 }
115118
116119 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
4040 "ssh"
4141 } else {
4242 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")
4444 })?
4545 }
4646 }
git-worktree/src/fs/cache/mod.rs+1−1
@@ -129,7 +129,7 @@ impl Cache { · 128 unmodified lines
129129
130130 self.at_path(
131131 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)),
133133 // is_dir,
134134 find,
135135 )
git-worktree/src/fs/cache/state.rs+1−1
@@ -275,7 +275,7 @@ impl State { · 274 unmodified lines
275275 Case::Sensitive => basename == t.0,
276276 Case::Fold => basename.eq_ignore_ascii_case(t.0),
277277 }
278− .then(|| t.1)
278+ .then_some(t.1)
279279 })?;
280280 // See https://github.com/git/git/blob/master/dir.c#L912:L912
281281 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
382382 for entry in results_by_hours.iter() {
383383 entry.write_to(
384384 total_hours,
385− file_stats.then(|| total_files),
386− line_stats.then(|| total_lines),
385+ file_stats.then_some(total_files),
386+ line_stats.then_some(total_lines),
387387 &mut out,
388388 )?;
389389 writeln!(out)?;
@@ -395,7 +395,7 @@ where · 5 unmodified lines
395395 total_hours,
396396 total_hours / HOURS_PER_WORKDAY,
397397 total_commits,
398− is_shallow.then(|| " (shallow)").unwrap_or_default(),
398+ is_shallow.then_some(" (shallow)").unwrap_or_default(),
399399 num_authors
400400 )?;
401401 if file_stats {
gitoxide-core/src/index/checkout.rs+1−1
@@ -124,7 +124,7 @@ pub fn checkout_exclusive( · 123 unmodified lines
124124 progress.done(format!(
125125 "Created {} {} files{} ({})",
126126 files_updated,
127− no_repo.then(|| "empty").unwrap_or_default(),
127+ no_repo.then_some("empty").unwrap_or_default(),
128128 should_interrupt
129129 .load(Ordering::Relaxed)
130130 .then(|| {
gitoxide-core/src/repository/clone.rs+5−2
@@ -52,8 +52,11 @@ pub(crate) mod function { · 51 unmodified lines
5252 let mut prepare = git::clone::PrepareFetch::new(
5353 url,
5454 directory,
55− bare.then(|| git::create::Kind::Bare)
56− .unwrap_or(git::create::Kind::WithWorktree),
55+ if bare {
56+ git::create::Kind::Bare
57+ } else {
58+ git::create::Kind::WithWorktree
59+ },
5760 git::create::Options::default(),
5861 {
5962 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
102102 .then(|| format!(", include level {}", meta.level))
103103 .unwrap_or_default(),
104104 (meta.trust != git::sec::Trust::Full)
105− .then(|| ", untrusted")
105+ .then_some(", untrusted")
106106 .unwrap_or_default()
107107 )
108108 }
gitoxide-core/src/repository/exclude.rs+1−1
@@ -51,7 +51,7 @@ pub fn query( · 50 unmodified lines
5151 let entry = cache.at_entry(path, is_dir, |oid, buf| repo.objects.find_blob(oid, buf))?;
5252 let match_ = entry
5353 .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));
5555 match match_ {
5656 Some(m) => writeln!(
5757 out,
gitoxide-core/src/repository/remote.rs+7−3
@@ -156,9 +156,13 @@ mod refs_impl { · 155 unmodified lines
156156 match repo.try_find_reference(local)? {
157157 Some(tracking) => {
158158 let msg = match tracking.try_id() {
159− Some(id) => (id.as_ref() == target_id)
160− .then(|| "[up-to-date]")
161− .unwrap_or("[changed]"),
159+ Some(id) => {
160+ if id.as_ref() == target_id {
161+ "[up-to-date]"
162+ } else {
163+ "[changed]"
164+ }
165+ }
162166 None => "[skipped]",
163167 };
164168 writeln!(out, "{msg}")
gitoxide-core/src/repository/tree.rs+3−3
@@ -130,12 +130,12 @@ pub fn info( · 129 unmodified lines
130130
131131 let tree = treeish_to_tree(treeish, &repo)?;
132132
133− let mut delegate = entries::Traverse::new(extended.then(|| &repo), None);
133+ let mut delegate = entries::Traverse::new(extended.then_some(&repo), None);
134134 tree.traverse().breadthfirst(&mut delegate)?;
135135
136136 #[cfg(feature = "serde1")]
137137 {
138− delegate.stats.bytes = extended.then(|| delegate.stats.num_bytes);
138+ delegate.stats.bytes = extended.then_some(delegate.stats.num_bytes);
139139 serde_json::to_writer_pretty(out, &delegate.stats)?;
140140 }
141141
@@ -157,7 +157,7 @@ pub fn entries( · 15 unmodified lines
157157 let tree = treeish_to_tree(treeish, &repo)?;
158158
159159 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));
161161 tree.traverse().breadthfirst(&mut delegate)?;
162162 } else {
163163 for entry in tree.iter() {
src/plumbing/main.rs+2−2
@@ -389,7 +389,7 @@ pub fn main() -> Result<()> { · 388 unmodified lines
389389 let context = core::pack::create::Context {
390390 thread_limit,
391391 thin,
392− nondeterministic_thread_count: nondeterministic_count.then(|| counting_threads),
392+ nondeterministic_thread_count: nondeterministic_count.then_some(counting_threads),
393393 pack_cache_size_in_bytes: pack_cache_size_mb.unwrap_or(0) * 1_000_000,
394394 object_cache_size_in_bytes: object_cache_size_mb.unwrap_or(0) * 1_000_000,
395395 statistics: if statistics { Some(format) } else { None },
@@ -638,7 +638,7 @@ pub fn main() -> Result<()> { · 242 unmodified lines
638638 progress,
639639 &should_interrupt,
640640 core::repository::verify::Context {
641− output_statistics: statistics.then(|| format),
641+ output_statistics: statistics.then_some(format),
642642 algorithm,
643643 verify_mode: verify_mode(decode, re_encode),
644644 thread_limit,
src/plumbing/progress.rs+15−4
@@ -1,3 +1,4 @@
1+use std::borrow::Cow;
12 use std::fmt::{Display, Formatter};
23
34 use crosstermion::crossterm::style::Stylize;
@@ -55,7 +56,13 @@ impl Usage { · 51 unmodified lines
5556 NotApplicable { .. } => "❌",
5657 Planned { .. } => "🕒",
5758 NotPlanned { .. } => "🤔",
58− InModule { deviation, .. } => deviation.is_some().then(|| "👌️").unwrap_or("✅"),
59+ InModule { deviation, .. } => {
60+ if deviation.is_some() {
61+ "👌️"
62+ } else {
63+ "✅"
64+ }
65+ }
5966 }
6067 }
6168 }
@@ -69,7 +76,7 @@ struct Record { · 7 unmodified lines
6976 impl Tabled for Record {
7077 const LENGTH: usize = 3;
7178
72− fn fields(&self) -> Vec<String> {
79+ fn fields(&self) -> Vec<Cow<'_, str>> {
7380 let mut tokens = self.config.split('.');
7481 let mut buf = vec![{
7582 let name = tokens.next().expect("present");
@@ -82,10 +89,14 @@ impl Tabled for Record { · 6 unmodified lines
8289 }];
8390 buf.extend(tokens.map(ToOwned::to_owned));
8491
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+ ]
8697 }
8798
88− fn headers() -> Vec<String> {
99+ fn headers() -> Vec<Cow<'static, str>> {
89100 vec![]
90101 }
91102 }
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
6262 let mut buf = Vec::with_capacity(512);
6363 let case = git_worktree::fs::Capabilities::probe(&work_tree)
6464 .ignore_case
65− .then(|| git_attributes::glob::pattern::Case::Fold)
65+ .then_some(git_attributes::glob::pattern::Case::Fold)
6666 .unwrap_or_default();
6767 let state = git_worktree::fs::cache::State::IgnoreStack(git_worktree::fs::cache::state::Ignore::new(
6868 Default::default(),