Skip to content

Commit 6e38843

Browse files
committed
expr: Minor linting fix
1 parent 1ea6db8 commit 6e38843

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/uu/expr/src/syntax_tree.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,12 +211,12 @@ fn validate_regex(pattern: &str) -> ExprResult<()> {
211211
invalid_content_error = true;
212212
}
213213
(Some(x), None) | (Some(x), Some("")) => {
214-
if !x.parse::<i16>().is_ok() {
214+
if x.parse::<i16>().is_err() {
215215
invalid_content_error = true;
216216
}
217217
}
218218
(None, Some(x)) | (Some(""), Some(x)) => {
219-
if !x.parse::<i16>().is_ok() {
219+
if x.parse::<i16>().is_err() {
220220
invalid_content_error = true;
221221
}
222222
}
@@ -706,13 +706,13 @@ mod test {
706706

707707
#[test]
708708
fn starting_stars_become_escaped() {
709-
let result = AstNode::parse(&["yolo", ":", r"*yolo"])
709+
let result = AstNode::parse(&["cats", ":", r"*cats"])
710710
.unwrap()
711711
.eval()
712712
.unwrap();
713713
assert_eq!(result.eval_as_string(), "0");
714714

715-
let result = AstNode::parse(&["*yolo", ":", r"*yolo"])
715+
let result = AstNode::parse(&["*cats", ":", r"*cats"])
716716
.unwrap()
717717
.eval()
718718
.unwrap();

0 commit comments

Comments
 (0)