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

Code before:
                                } else {
                                    end
                                };

                                rows_to_drop.extend((start as usize)..=(end as usize));
                            }
                            Bound::Excluded(end) => {
                                if end <= start {
                                    return Err(ShellError::UnsupportedInput {
                                        msg: "The upper bound must be greater than the lower bound"
                                            .into(),
                                        input: "value originates from here".into(),
                                        msg_span: head,
                                        input_span: value.span(),
                                    });
                                }

                                let end = if let PipelineData::Value(Value::List { vals, .. }, _) =
                                    &input
                                {
                                    (end - 1).min((vals.len() as i64) - 1)
                                } else {
                                    end - 1
                                };

                                rows_to_drop.extend((start as usize)..=(end as usize));
                            }
                            Bound::Unbounded => {
                                let start_usize = start as usize;
                                min_unbounded_start = Some(
                                    min_unbounded_start.map_or(start_usize, |s| s.min(start_usize)),
                                );
                            }
                        }
                    }
                    Range::FloatRange(_) => {
                        return Err(ShellError::UnsupportedInput {
                            msg: "float range not supported".into(),
                            input: "value originates from here".into(),
                            msg_span: head,
                            input_span: value.span(),
                        });
                    }
                }
            } else {
                return Err(ShellError::TypeMismatch {
                    err_message: "Expected int or range".into(),
                    span: value.span(),
                });
            }
        }

Review comment (suggestion):
same as above

```suggestion
                                rows_to_drop.extend((start as usize)..<(end as usize));
```

Code after:
        } else if let Ok(range) = value.as_range() {
            match range {
                Range::IntRange(range) => {
                    let start = range.start();
                    if start < 0 {
                        return Err(ShellError::UnsupportedInput {
                            msg: "drop nth accepts only positive ints".into(),
                            input: "value originates from here".into(),
                            msg_span: head,
                            input_span: value.span(),
                        });
                    }

                    match range.end() {
                        Bound::Included(end) => {
                            if end < start {
                                return Err(ShellError::UnsupportedInput {
                                    msg: "The upper bound must be greater than or equal to the lower bound".into(),
                                    input: "value originates from here".into(),
                                    msg_span: head,
                                    input_span: value.span(),
                                });
                            }
                            rows_to_drop.extend((start as usize)..=(end as usize));
                        }
                        Bound::Excluded(end) => {
                            if end <= start {
                                return Err(ShellError::UnsupportedInput {
                                    msg: "The upper bound must be greater than the lower bound"
                                        .into(),
                                    input: "value originates from here".into(),
                                    msg_span: head,
                                    input_span: value.span(),
                                });
                            }
                            rows_to_drop.extend((start as usize)..(end as usize));
                        }
                        Bound::Unbounded => {
                            let start_usize = start as usize;
                            min_unbounded_start = Some(
                                min_unbounded_start.map_or(start_usize, |s| s.min(start_usize)),
                            );
                        }
                    }
                }
                Range::FloatRange(_) => {
                    return Err(ShellError::UnsupportedInput {
                        msg: "float range not supported".into(),
                        input: "value originates from here".into(),
                        msg_span: head,
                        input_span: value.span(),