File tree 12 files changed +59
-33
lines changed
crates/xtask-stale-label/src
12 files changed +59
-33
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ windows-sys = "0.48"
95
95
96
96
[package ]
97
97
name = " cargo"
98
- version = " 0.73.0 "
98
+ version = " 0.73.1 "
99
99
edition = " 2021"
100
100
license = " MIT OR Apache-2.0"
101
101
homepage = " https://crates.io"
@@ -181,10 +181,12 @@ fwdansi.workspace = true
181
181
workspace = true
182
182
features = [
183
183
" Win32_Foundation" ,
184
+ " Win32_Security" ,
184
185
" Win32_Storage_FileSystem" ,
186
+ " Win32_System_IO" ,
185
187
" Win32_System_Console" ,
186
- " Win32_System_Threading" ,
187
188
" Win32_System_JobObjects" ,
189
+ " Win32_System_Threading" ,
188
190
]
189
191
190
192
[dev-dependencies ]
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ fn main() {
34
34
35
35
for ( label, value) in autolabel. iter ( ) {
36
36
let Some ( trigger_files) = value. get ( "trigger_files" ) else {
37
- continue
37
+ continue ;
38
38
} ;
39
39
let trigger_files = trigger_files. as_array ( ) . expect ( "an array" ) ;
40
40
let missing_files: Vec < _ > = trigger_files
Original file line number Diff line number Diff line change 5
5
//! rough outline is:
6
6
//!
7
7
//! 1. Resolve the dependency graph (see [`ops::resolve`]).
8
- //! 2. Download any packages needed (see [`PackageSet`](crate::core::PackageSet)) .
8
+ //! 2. Download any packages needed (see [`PackageSet`].
9
9
//! 3. Generate a list of top-level "units" of work for the targets the user
10
10
//! requested on the command-line. Each [`Unit`] corresponds to a compiler
11
11
//! invocation. This is done in this module ([`UnitGenerator::generate_root_units`]).
Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ pub fn certificate_check(
141
141
let Some ( host_key) = cert. as_hostkey ( ) else {
142
142
// Return passthrough for TLS X509 certificates to use whatever validation
143
143
// was done in git2.
144
- return Ok ( CertificateCheckStatus :: CertificatePassthrough )
144
+ return Ok ( CertificateCheckStatus :: CertificatePassthrough ) ;
145
145
} ;
146
146
// If a nonstandard port is in use, check for that first.
147
147
// The fallback to check without a port is handled in the HostKeyNotFound handler.
@@ -611,10 +611,18 @@ impl KnownHost {
611
611
}
612
612
613
613
fn hashed_hostname_matches ( host : & str , hashed : & str ) -> bool {
614
- let Some ( ( b64_salt, b64_host) ) = hashed. split_once ( '|' ) else { return false ; } ;
615
- let Ok ( salt) = STANDARD . decode ( b64_salt) else { return false ; } ;
616
- let Ok ( hashed_host) = STANDARD . decode ( b64_host) else { return false ; } ;
617
- let Ok ( mut mac) = hmac:: Hmac :: < sha1:: Sha1 > :: new_from_slice ( & salt) else { return false ; } ;
614
+ let Some ( ( b64_salt, b64_host) ) = hashed. split_once ( '|' ) else {
615
+ return false ;
616
+ } ;
617
+ let Ok ( salt) = STANDARD . decode ( b64_salt) else {
618
+ return false ;
619
+ } ;
620
+ let Ok ( hashed_host) = STANDARD . decode ( b64_host) else {
621
+ return false ;
622
+ } ;
623
+ let Ok ( mut mac) = hmac:: Hmac :: < sha1:: Sha1 > :: new_from_slice ( & salt) else {
624
+ return false ;
625
+ } ;
618
626
mac. update ( host. as_bytes ( ) ) ;
619
627
let result = mac. finalize ( ) . into_bytes ( ) ;
620
628
hashed_host == & result[ ..]
Original file line number Diff line number Diff line change @@ -808,7 +808,9 @@ impl<'cfg> Downloads<'cfg> {
808
808
/// Updates the state of the progress bar for downloads.
809
809
fn tick ( & self ) -> CargoResult < ( ) > {
810
810
let mut progress = self . progress . borrow_mut ( ) ;
811
- let Some ( progress) = progress. as_mut ( ) else { return Ok ( ( ) ) ; } ;
811
+ let Some ( progress) = progress. as_mut ( ) else {
812
+ return Ok ( ( ) ) ;
813
+ } ;
812
814
813
815
// Since the sparse protocol discovers dependencies as it goes,
814
816
// it's not possible to get an accurate progress indication.
Original file line number Diff line number Diff line change @@ -887,7 +887,7 @@ impl<'cfg> Source for RegistrySource<'cfg> {
887
887
888
888
impl RegistryConfig {
889
889
/// File name of [`RegistryConfig`].
890
- const NAME : & str = "config.json" ;
890
+ const NAME : & ' static str = "config.json" ;
891
891
}
892
892
893
893
/// Get the maximum upack size that Cargo permits
Original file line number Diff line number Diff line change @@ -73,7 +73,8 @@ pub fn public_token_from_credential(
73
73
source_id : & SourceId ,
74
74
mutation : Option < & ' _ Mutation < ' _ > > ,
75
75
) -> CargoResult < Secret < String > > {
76
- let RegistryCredentialConfig :: AsymmetricKey ( ( secret_key, secret_key_subject) ) = credential else {
76
+ let RegistryCredentialConfig :: AsymmetricKey ( ( secret_key, secret_key_subject) ) = credential
77
+ else {
77
78
anyhow:: bail!( "credential must be an asymmetric secret key" )
78
79
} ;
79
80
Original file line number Diff line number Diff line change @@ -207,7 +207,11 @@ impl DocFragment {
207
207
let syn:: Meta :: NameValue ( nv) = & attr. meta else {
208
208
anyhow:: bail!( "unsupported attr meta for {:?}" , attr. meta. path( ) )
209
209
} ;
210
- let syn:: Expr :: Lit ( syn:: ExprLit { lit : syn:: Lit :: Str ( lit) , .. } ) = & nv. value else {
210
+ let syn:: Expr :: Lit ( syn:: ExprLit {
211
+ lit : syn:: Lit :: Str ( lit) ,
212
+ ..
213
+ } ) = & nv. value
214
+ else {
211
215
anyhow:: bail!( "only string literals are supported" )
212
216
} ;
213
217
Ok ( Self {
@@ -373,16 +377,21 @@ fn unindent_doc_fragments(docs: &mut [DocFragment]) {
373
377
let Some ( min_indent) = docs
374
378
. iter ( )
375
379
. map ( |fragment| {
376
- fragment. doc . as_str ( ) . lines ( ) . fold ( usize:: MAX , |min_indent, line| {
377
- if line. chars ( ) . all ( |c| c. is_whitespace ( ) ) {
378
- min_indent
379
- } else {
380
- // Compare against either space or tab, ignoring whether they are
381
- // mixed or not.
382
- let whitespace = line. chars ( ) . take_while ( |c| * c == ' ' || * c == '\t' ) . count ( ) ;
383
- min_indent. min ( whitespace)
384
- }
385
- } )
380
+ fragment
381
+ . doc
382
+ . as_str ( )
383
+ . lines ( )
384
+ . fold ( usize:: MAX , |min_indent, line| {
385
+ if line. chars ( ) . all ( |c| c. is_whitespace ( ) ) {
386
+ min_indent
387
+ } else {
388
+ // Compare against either space or tab, ignoring whether they are
389
+ // mixed or not.
390
+ let whitespace =
391
+ line. chars ( ) . take_while ( |c| * c == ' ' || * c == '\t' ) . count ( ) ;
392
+ min_indent. min ( whitespace)
393
+ }
394
+ } )
386
395
} )
387
396
. min ( )
388
397
else {
Original file line number Diff line number Diff line change @@ -2835,7 +2835,9 @@ fn parse_unstable_lints<T: Deserialize<'static>>(
2835
2835
config : & Config ,
2836
2836
warnings : & mut Vec < String > ,
2837
2837
) -> CargoResult < Option < T > > {
2838
- let Some ( lints) = lints else { return Ok ( None ) ; } ;
2838
+ let Some ( lints) = lints else {
2839
+ return Ok ( None ) ;
2840
+ } ;
2839
2841
2840
2842
if !config. cli_unstable ( ) . lints {
2841
2843
warn_for_lint_feature ( config, warnings) ;
@@ -2878,7 +2880,9 @@ switch to nightly channel you can pass
2878
2880
}
2879
2881
2880
2882
fn verify_lints ( lints : Option < TomlLints > ) -> CargoResult < Option < TomlLints > > {
2881
- let Some ( lints) = lints else { return Ok ( None ) ; } ;
2883
+ let Some ( lints) = lints else {
2884
+ return Ok ( None ) ;
2885
+ } ;
2882
2886
2883
2887
for ( tool, lints) in & lints {
2884
2888
let supported = [ "rust" , "clippy" , "rustdoc" ] ;
Original file line number Diff line number Diff line change @@ -314,9 +314,9 @@ fn cargo_bench_failing_test() {
314
314
[RUNNING] [..] (target/release/deps/foo-[..][EXE])" ,
315
315
)
316
316
. with_stdout_contains ( "[..]thread '[..]' panicked at[..]" )
317
- . with_stdout_contains ( "[..]assertion failed[..]" )
318
- . with_stdout_contains ( "[..]left: ` \" hello\" ` [..]" )
319
- . with_stdout_contains ( "[..]right: ` \" nope\" ` [..]" )
317
+ . with_stdout_contains ( "[..]assertion [..] failed[..]" )
318
+ . with_stdout_contains ( "[..]left: [..] \" hello\" [..]" )
319
+ . with_stdout_contains ( "[..]right: [..] \" nope\" [..]" )
320
320
. with_stdout_contains ( "[..]src/main.rs:15[..]" )
321
321
. with_status ( 101 )
322
322
. run ( ) ;
Original file line number Diff line number Diff line change @@ -389,10 +389,10 @@ failures:
389
389
---- test_hello stdout ----
390
390
[..]thread '[..]' panicked at [..]" ,
391
391
)
392
- . with_stdout_contains ( "[..]assertion failed[..]" )
393
- . with_stdout_contains ( "[..]`( left == right)` [..]" )
394
- . with_stdout_contains ( "[..]left: ` \" hello\" `, [..]" )
395
- . with_stdout_contains ( "[..]right: ` \" nope\" ` [..]" )
392
+ . with_stdout_contains ( "[..]assertion [..] failed[..]" )
393
+ . with_stdout_contains ( "[..]left == right[..]" )
394
+ . with_stdout_contains ( "[..]left: [..] \" hello\" [..]" )
395
+ . with_stdout_contains ( "[..]right: [..] \" nope\" [..]" )
396
396
. with_stdout_contains ( "[..]src/main.rs:12[..]" )
397
397
. with_stdout_contains (
398
398
"\
You can’t perform that action at this time.
0 commit comments