Skip to content

Commit 5406630

Browse files
committed
Merge branch 'main' into write-sparse-index (upgrade to Rust 1.65)
2 parents c4e6849 + f2a8a45 commit 5406630

File tree

49 files changed

+109
-79
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+109
-79
lines changed

cargo-smart-release/src/bat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ impl Support {
3333
return Ok(());
3434
}
3535
if Command::new("bat")
36-
.args(&["--paging=always", "-l=md", "--file-name"])
36+
.args(["--paging=always", "-l=md", "--file-name"])
3737
.arg(format!("{} ({})", path_for_title.display(), additional_title.as_ref()))
3838
.arg(path)
3939
.status()?

cargo-smart-release/src/changelog/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ impl Section {
108108
return false;
109109
};
110110
segments.iter().any(
111-
|s| matches!(s, section::Segment::Conventional(section::segment::Conventional {kind, removed, is_breaking, ..}) if *is_breaking && removed.is_empty() && as_headline(*kind).is_none()),
111+
|s| matches!(s, section::Segment::Conventional(section::segment::Conventional {kind, removed, is_breaking, ..}) if *is_breaking && removed.is_empty() && as_headline(kind).is_none()),
112112
)
113113
}
114114
}

cargo-smart-release/src/changelog/parse.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ fn parse_conventional_to_next_section_title(
246246
]
247247
.iter()
248248
.find(|kind| {
249-
let headline = section::segment::conventional::as_headline(*kind).unwrap_or(*kind);
249+
let headline = section::segment::conventional::as_headline(kind).unwrap_or(*kind);
250250
let common_len = headline.len().min(title.len());
251251
title
252252
.get(..common_len)
@@ -256,7 +256,7 @@ fn parse_conventional_to_next_section_title(
256256
.expect("BUG: this list needs an update too if new kinds of conventional messages are added");
257257

258258
let mut conventional = section::segment::Conventional {
259-
kind: *kind,
259+
kind,
260260
is_breaking,
261261
removed: vec![],
262262
messages: vec![],

cargo-smart-release/src/command/release/manifest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ fn generate_commit_message(
340340
match (
341341
pending_changelogs.len(),
342342
pending_changelogs.iter().fold(0usize, |mut acc, (_, _, lock)| {
343-
acc += if !lock.resource_path().is_file() { 1 } else { 0 };
343+
acc += usize::from(!lock.resource_path().is_file());
344344
acc
345345
})
346346
) {

cargo-smart-release/src/command/release/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ fn perform_release(ctx: &Context, options: Options, crates: &[traverse::Dependen
416416
let prevent_default_members = ctx.base.meta.workspace_members.len() > 1;
417417
for (publishee, new_version) in crates.iter().filter_map(try_to_published_crate_and_new_version) {
418418
if let Some((crate_, version)) = successful_publishees_and_version.last() {
419-
if let Err(err) = wait_for_release(*crate_, version, options) {
419+
if let Err(err) = wait_for_release(crate_, version, options) {
420420
log::warn!(
421421
"Failed to wait for crates-index update - trying to publish '{} v{}' anyway: {}.",
422422
publishee.name,

git-config-value/tests/value/boolean.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ fn ignores_case() {
3030
// Random subset
3131
for word in &["no", "yes", "on", "off", "true", "false"] {
3232
let first: bool = Boolean::try_from(b(word)).unwrap().into();
33-
let second: bool = Boolean::try_from(b(&*word.to_uppercase())).unwrap().into();
33+
let second: bool = Boolean::try_from(b(&word.to_uppercase())).unwrap().into();
3434
assert_eq!(first, second);
3535
}
3636
}

git-config/src/file/access/read_only.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ impl<'event> File<'event> {
264264
///
265265
/// This is the metadata the file was instantiated with for use in all newly created sections.
266266
pub fn meta(&self) -> &Metadata {
267-
&*self.meta
267+
&self.meta
268268
}
269269

270270
/// Similar to [`meta()`][File::meta()], but with shared ownership.

git-config/tests/file/mod.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ pub fn cow_str(s: &str) -> Cow<'_, BStr> {
88

99
#[test]
1010
fn size_in_memory() {
11-
assert_eq!(
12-
std::mem::size_of::<git_config::File<'_>>(),
13-
1040,
14-
"This shouldn't change without us noticing"
11+
let actual = std::mem::size_of::<git_config::File<'_>>();
12+
assert!(
13+
actual <= 1040,
14+
"{} <= 1040: This shouldn't change without us noticing",
15+
actual
1516
);
1617
}
1718

git-config/tests/parse/mod.rs

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,23 @@ mod section;
99

1010
#[test]
1111
fn size_in_memory() {
12-
assert_eq!(
13-
std::mem::size_of::<Section<'_>>(),
14-
6768,
15-
"This shouldn't change without us noticing"
12+
let actual = std::mem::size_of::<Section<'_>>();
13+
assert!(
14+
actual <= 6768,
15+
"{} <= 6768: This shouldn't change without us noticing",
16+
actual
1617
);
17-
assert_eq!(
18-
std::mem::size_of::<Event<'_>>(),
19-
104,
20-
"This shouldn't change without us noticing"
18+
let actual = std::mem::size_of::<Event<'_>>();
19+
assert!(
20+
actual <= 104,
21+
"{} <= 104: This shouldn't change without us noticing",
22+
actual
2123
);
22-
assert_eq!(
23-
std::mem::size_of::<Events<'_>>(),
24-
872,
25-
"This shouldn't change without us noticing"
24+
let actual = std::mem::size_of::<Events<'_>>();
25+
assert!(
26+
actual <= 872,
27+
"{} <= 872: This shouldn't change without us noticing",
28+
actual
2629
);
2730
}
2831

git-config/tests/value/normalize.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ fn all_quote_optimization_is_correct() {
4242
#[test]
4343
fn quotes_right_next_to_each_other() {
4444
let cow = normalize_bstr("\"hello\"\" world\"");
45-
assert_eq!(cow, cow_str("hello world").to_owned());
45+
assert_eq!(cow, cow_str("hello world").clone());
4646
assert!(matches!(cow, Cow::Owned(_)));
4747
}
4848

4949
#[test]
5050
fn escaped_quotes_are_kept() {
5151
let cow = normalize_bstr(r#""hello \"\" world""#);
52-
assert_eq!(cow, cow_str("hello \"\" world").to_owned(),);
52+
assert_eq!(cow, cow_str("hello \"\" world").clone(),);
5353
assert!(matches!(cow, Cow::Owned(_)));
5454
}
5555

0 commit comments

Comments
 (0)