Skip to content

Commit

Permalink
doesn't need a usize for nb_arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
vic1707 committed Oct 23, 2023
1 parent 0c58627 commit 4df3c9f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ impl<'a> ParserImpl<'a> {

fn parse_arguments(
&mut self,
mut nb_args: usize,
mut nb_args: u8,
) -> Result<Vec<Element<'a>>, ParseError> {
let mut args = Vec::with_capacity(nb_args);
let mut args = Vec::with_capacity(usize::from(nb_args));
self.cursor += 1;

while nb_args > 0 {
Expand Down
4 changes: 2 additions & 2 deletions src/token/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
pub struct Function<'a> {
pub(crate) name: &'a str,
pub(crate) func: fn(&[f64]) -> f64,
pub(crate) nb_args: usize,
pub(crate) nb_args: u8,
}

impl<'a> Function<'a> {
pub const fn new(
name: &'a str,
func: fn(&[f64]) -> f64,
nb_args: usize,
nb_args: u8,
) -> Self {
Self {
name,
Expand Down

0 comments on commit 4df3c9f

Please sign in to comment.