From 28b99bfaf7a0e92b601c7ea8d9f9a958cf769aaa Mon Sep 17 00:00:00 2001 From: Stefan Holderbach Date: Fri, 28 Jul 2023 19:31:48 +0200 Subject: [PATCH] Narrow signature of `math ceil`/`floor` (#9836) # Description More narrow attempt than #9740 This doesn't cause issues with the current `test_examples` infrastructure. But allows the output of those clearly integer producing commands to be used with functions declaring `list` or `int` # User-Facing Changes see above # Tests + Formatting None --- crates/nu-command/src/math/ceil.rs | 2 +- crates/nu-command/src/math/floor.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/nu-command/src/math/ceil.rs b/crates/nu-command/src/math/ceil.rs index 2dd26f769f..e345e5a242 100644 --- a/crates/nu-command/src/math/ceil.rs +++ b/crates/nu-command/src/math/ceil.rs @@ -16,7 +16,7 @@ impl Command for SubCommand { (Type::Number, Type::Int), ( Type::List(Box::new(Type::Number)), - Type::List(Box::new(Type::Number)), + Type::List(Box::new(Type::Int)), ), ]) .allow_variants_without_examples(true) diff --git a/crates/nu-command/src/math/floor.rs b/crates/nu-command/src/math/floor.rs index beab1159e2..f60958254e 100644 --- a/crates/nu-command/src/math/floor.rs +++ b/crates/nu-command/src/math/floor.rs @@ -16,7 +16,7 @@ impl Command for SubCommand { (Type::Number, Type::Int), ( Type::List(Box::new(Type::Number)), - Type::List(Box::new(Type::Number)), + Type::List(Box::new(Type::Int)), ), ]) .allow_variants_without_examples(true)