File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ impl ArgumentParser for IntParser {
16
16
fn parse ( & self , _ctx : Arc < CommandContext > , input : Arc < Mutex < CommandInput > > ) -> ParserResult {
17
17
let token = input. lock ( ) . unwrap ( ) . read_string ( ) ;
18
18
19
- match token. parse :: < u32 > ( ) {
19
+ match token. parse :: < i32 > ( ) {
20
20
Ok ( int) => Ok ( Box :: new ( int) ) ,
21
21
Err ( err) => Err ( error ( err) ) ,
22
22
}
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ async fn arg_parse_test() {
79
79
#[ tokio:: test]
80
80
async fn parse_test ( ) {
81
81
async fn test_executor ( ctx : Arc < CommandContext > ) -> CommandResult {
82
- let num = ctx. arg :: < u32 > ( "number" ) ;
82
+ let num = ctx. arg :: < i32 > ( "number" ) ;
83
83
assert_eq ! ( num. to_string( ) , ctx. input. lock( ) . unwrap( ) . input) ;
84
84
Ok ( ( ) )
85
85
}
Original file line number Diff line number Diff line change @@ -31,11 +31,11 @@ async fn root(ctx: Arc<CommandContext>) -> CommandResult {
31
31
async fn abc ( ctx : Arc < CommandContext > ) -> CommandResult {
32
32
let message = ctx. arg :: < String > ( "message" ) ;
33
33
let word = ctx. arg :: < String > ( "word" ) ;
34
- let number = ctx. arg :: < u32 > ( "number" ) ;
34
+ let number = ctx. arg :: < i32 > ( "number" ) ;
35
35
36
36
ctx. reply (
37
37
TextComponentBuilder :: new ( format ! (
38
- "Message: {message:?}, Word: {word:?}, Message : {number}"
38
+ "Message: {message:?}, Word: {word:?}, Number : {number}"
39
39
) )
40
40
. build ( ) ,
41
41
)
You can’t perform that action at this time.
0 commit comments