Skip to content

Commit b1e3233

Browse files
committed
chore: upgrade to rust toolchain to 1.89.0
1 parent c7e02cf commit b1e3233

4 files changed

Lines changed: 13 additions & 19 deletions

File tree

rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.87.0
1+
1.89.0

vectorctl-migration/src/revision.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,11 @@ impl RevisionGraph {
5555
});
5656
});
5757
(0..nodes.len()).for_each(|ix| {
58-
if let Some(parent_rev) = nodes[ix].migration.runner.revision().down_revision {
59-
if let Some(&p_ix) = index.get(parent_rev) {
58+
if let Some(parent_rev) = nodes[ix].migration.runner.revision().down_revision
59+
&& let Some(&p_ix) = index.get(parent_rev) {
6060
nodes[ix].parent = Some(p_ix);
6161
nodes[p_ix].children.push(ix);
6262
}
63-
}
6463
});
6564
let queue_ix = nodes
6665
.iter()

vectorctl-template/src/migration.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,20 @@ impl MigrationTemplate {
3939

4040
impl MigrationTemplateBuilder {
4141
fn validate(&self) -> Result<(), String> {
42-
if let Some(version) = self.version.as_ref() {
43-
if !SEMVER_REGEX.is_match(version) {
42+
if let Some(version) = self.version.as_ref()
43+
&& !SEMVER_REGEX.is_match(version) {
4444
return Err(format!("Invalid version: {}", version));
4545
}
46-
}
4746

48-
if let Some(package_name) = self.package_name.as_ref() {
49-
if !STRING_REGEX.is_match(package_name) {
47+
if let Some(package_name) = self.package_name.as_ref()
48+
&& !STRING_REGEX.is_match(package_name) {
5049
return Err(format!("Invalid package_name: {}", package_name));
5150
}
52-
}
5351

54-
if let Some(rust_edition) = self.rust_edition.as_ref() {
55-
if !STRING_REGEX.is_match(rust_edition) {
52+
if let Some(rust_edition) = self.rust_edition.as_ref()
53+
&& !STRING_REGEX.is_match(rust_edition) {
5654
return Err(format!("Invalid rust edition: {}", rust_edition));
5755
}
58-
}
5956

6057
Ok(())
6158
}

vectorctl-template/src/revision.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,18 @@ impl RevisionTemplateBuilder {
7272
return Err("revision_id is required".into());
7373
}
7474

75-
if let Some(Some(down_revision_id)) = self.down_revision_id.as_ref() {
76-
if !REVISION_ID_REGEX.is_match(down_revision_id) {
75+
if let Some(Some(down_revision_id)) = self.down_revision_id.as_ref()
76+
&& !REVISION_ID_REGEX.is_match(down_revision_id) {
7777
return Err(format!(
7878
"down_revision_id `{}` may only contain letters, numbers, dashes or underscores",
7979
down_revision_id
8080
));
8181
}
82-
}
8382

84-
if let Some(Some(message)) = self.message.as_ref() {
85-
if message.trim().is_empty() {
83+
if let Some(Some(message)) = self.message.as_ref()
84+
&& message.trim().is_empty() {
8685
return Err("message cannot be empty".into());
8786
}
88-
}
8987

9088
Ok(())
9189
}

0 commit comments

Comments
 (0)