Skip to content

Commit 1f1cb9e

Browse files
fix: improve string comparisons in disk space validation
1 parent 1394abe commit 1f1cb9e

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,4 +753,4 @@ mod test {
753753
// Assert that the deserialized data matches the original
754754
assert_eq!(faux, in_faux);
755755
}
756-
}
756+
}

src/utils/ssh_deploy/validators.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ pub fn validate_system_requirements(
3333
Ok(())
3434
}
3535

36-
37-
3836
/// Get required resources based on SVM and node type
3937
///
4038
/// # Arguments
@@ -133,9 +131,9 @@ pub fn validate_disk_space(
133131
.get("disk_available")
134132
.and_then(|s| {
135133
// Parse disk space - handle different units (G, T)
136-
if s.ends_with('G') {
134+
if s.ends_with("G") {
137135
s[..s.len() - 1].parse::<f64>().ok().map(|v| v as u16)
138-
} else if s.ends_with('T') {
136+
} else if s.ends_with("T") {
139137
s[..s.len() - 1]
140138
.parse::<f64>()
141139
.ok()
@@ -154,4 +152,4 @@ pub fn validate_disk_space(
154152
}
155153

156154
Ok(())
157-
}
155+
}

0 commit comments

Comments
 (0)