mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 07:32:25 +02:00
Rework for new clippy lints (#12736)
- **Clippy lint `assigning_clones`** - **Clippy lint `legacy_numeric_constants`** - **`clippy::float_equality_without_abs`** - **`nu-table`: clippy::zero_repeat_side_effects** --------- Co-authored-by: Ian Manske <ian.manske@pm.me>
This commit is contained in:
committed by
GitHub
parent
0805f1fd90
commit
b88d8726d0
@ -150,7 +150,7 @@ fn action(input: &Value, args: &Arguments, head: Span) -> Value {
|
||||
head,
|
||||
),
|
||||
Ordering::Less => Value::binary(
|
||||
if end == isize::max_value() {
|
||||
if end == isize::MAX {
|
||||
val.iter()
|
||||
.skip(start as usize)
|
||||
.copied()
|
||||
|
@ -149,7 +149,7 @@ fn action(input: &Value, args: &Arguments, head: Span) -> Value {
|
||||
),
|
||||
Ordering::Less => Value::string(
|
||||
{
|
||||
if end == isize::max_value() {
|
||||
if end == isize::MAX {
|
||||
if args.graphemes {
|
||||
s.graphemes(true)
|
||||
.skip(start as usize)
|
||||
@ -245,7 +245,7 @@ mod tests {
|
||||
expectation("andre", (0, -1)),
|
||||
// str substring [ -4 , _ ]
|
||||
// str substring -4 ,
|
||||
expectation("dres", (-4, isize::max_value())),
|
||||
expectation("dres", (-4, isize::MAX)),
|
||||
expectation("", (0, -110)),
|
||||
expectation("", (6, 0)),
|
||||
expectation("", (6, -1)),
|
||||
|
Reference in New Issue
Block a user