Repository: nushell/nushell
File: crates/nu-command/src/filters/where_.rs (Rust)

Code before:
            },
            Example {
                description: "Filter items of a list with a row condition",
                example: "[1 2 3 4 5] | where $it > 2",
                result: Some(Value::test_list(vec![
                    Value::test_int(3),
                    Value::test_int(4),
                    Value::test_int(5),
                ])),
            },
            Example {
                description: "Filter items of a list with a closure",
                example: "[1 2 3 4 5] | where {|x| $x > 2 }",
                result: Some(Value::test_list(vec![
                    Value::test_int(3),
                    Value::test_int(4),
                    Value::test_int(5),
                ])),
            },
            Example {
                description: "Find files whose filenames don't begin with the correct sequential number",
                example: "ls | where type == file | sort-by name --natural | enumerate | where {|e| $e.item.name !~ $'^($e.index + 1)' } | get item",
                result: None,
            },
            Example {
                description: r#"Find case-insensitively files called "readme", with a subexpression"#,
                example: "ls | where ($it.name | str downcase) =~ readme",
                result: None,
            },
            Example {
                description: r#"Find case-insensitively files called "readme", with regex only"#,
                example: "ls | where name =~ '(?i)readme'",
                result: None,
            },
            Example {
                description: "Filter rows of a table according to a stored condition",
                example: "let cond = {|x| $x.a > 1}; [{a: 1} {a: 2}] | where $cond",
                result: Some(Value::test_list(vec![Value::test_record(record! {
                    "a" => Value::test_int(2),
                })])),
            },
            Example {
                description: "List all numbers above 3, using an existing closure condition",
                example: "let a = {$in > 3}; [1, 2, 5, 6] | where $a",
                result: Some(Value::test_list(vec![
                    Value::test_int(5),
                    Value::test_int(6),
                ])),
            },
        ]
    }

Review comment (security):
This is still a row condition just with the extra detail that the `$it` elision is not available.

```suggestion
                description: r#"Find case-insensitively files called "readme", with a subexpression inside the row condition"#,
```

Code after:
            },
            Example {
                description: "Filter items of a list with a row condition",
                example: "[1 2 3 4 5] | where $it > 2",
                result: Some(Value::test_list(vec![
                    Value::test_int(3),
                    Value::test_int(4),
                    Value::test_int(5),
                ])),
            },
            Example {
                description: "Filter items of a list with a closure",
                example: "[1 2 3 4 5] | where {|x| $x > 2 }",
                result: Some(Value::test_list(vec![
                    Value::test_int(3),
                    Value::test_int(4),
                    Value::test_int(5),
                ])),
            },
            Example {
                description: "Find files whose filenames don't begin with the correct sequential number",
                example: "ls | where type == file | sort-by name --natural | enumerate | where {|e| $e.item.name !~ $'^($e.index + 1)' } | get item",
                result: None,
            },
            Example {
                description: r#"Find case-insensitively files called "readme", with a subexpression inside the row condition"#,
                example: "ls | where ($it.name | str downcase) =~ readme",
                result: None,
            },
            Example {
                description: r#"Find case-insensitively files called "readme", with regex only"#,
                example: "ls | where name =~ '(?i)readme'",
                result: None,
            },
            Example {
                description: "Filter rows of a table according to a stored condition",
                example: "let cond = {|x| $x.a > 1}; [{a: 1} {a: 2}] | where $cond",
                result: Some(Value::test_list(vec![Value::test_record(record! {
                    "a" => Value::test_int(2),
                })])),
            },
            Example {
                description: "List all numbers above 3, using an existing closure condition",
                example: "let a = {$in > 3}; [1, 2, 5, 6] | where $a",
                result: Some(Value::test_list(vec![
                    Value::test_int(5),
                    Value::test_int(6),
                ])),
            },
        ]
    }