diff --git a/command_attr/src/lib.rs b/command_attr/src/lib.rs index 4f884104cde..5711282906a 100644 --- a/command_attr/src/lib.rs +++ b/command_attr/src/lib.rs @@ -63,7 +63,7 @@ macro_rules! match_options { /// - `#[checks(idents)]` /// Preconditions that must be met. Executed before the command's execution. /// `idents` is a list of identifiers, seperated by a comma, referencing functions of the declaration: -/// `fn(&mut Context, &Message, &mut Args, &CommandOptions) -> bool` +/// `fn(&mut Context, &Message, &mut Args, &CommandOptions) -> serenity::framework::standard::CheckResult` /// /// - `#[aliases(names)]` /// A list of other names that can be used to execute this command. @@ -72,10 +72,10 @@ macro_rules! match_options { /// - `#[description(desc)]`/`#[description = desc]` /// A summary of the command. /// -/// - `#[usage(usg)]`/`#[usage = usg] +/// - `#[usage(usg)]`/`#[usage = usg]` /// Usage schema of the command. /// -/// - `#[example(ex)]`/`#[example = ex] +/// - `#[example(ex)]`/`#[example = ex]` /// Example of the command's usage. /// /// - `#[min_args(min)]`, `#[max_args(max)]`, `#[num_args(min_and_max)]` @@ -99,7 +99,7 @@ macro_rules! match_options { /// - `#[owners_only]`/`#[owners_only(bool)]` /// Whether this command is exclusive to owners. /// -/// - `#[owner_privilege]`/`#[owner_privilege] +/// - `#[owner_privilege]`/`#[owner_privilege]` /// Whether this command has a privilege for owners (i.e certain options are ignored for them). /// /// - `#[sub(commands)]` diff --git a/src/framework/standard/parse.rs b/src/framework/standard/parse.rs index aeaa5c81393..ebd9c21643b 100644 --- a/src/framework/standard/parse.rs +++ b/src/framework/standard/parse.rs @@ -58,8 +58,7 @@ pub fn parse_prefix<'a>( } if let Some(prefix) = prefix { - let pos = stream.offset(); - stream.set(pos + prefix.len()); + stream.increment(prefix.len()); if config.with_whitespace.prefixes { stream.take_while(|s| s.is_whitespace()); @@ -128,8 +127,7 @@ impl<'msg, 'groups, 'config> CommandParser<'msg, 'groups, 'config> { let equals = self.as_lowercase(n, |n| n == *name && !self.config.disabled_commands.contains(n)); if equals { - let pos = self.stream.offset(); - self.stream.set(pos + n.len()); + self.stream.increment(n.len()); if self.config.with_whitespace.commands { self.stream.take_while(|s| s.is_whitespace()); @@ -157,8 +155,7 @@ impl<'msg, 'groups, 'config> CommandParser<'msg, 'groups, 'config> { let pp = self.next_text(|| p.chars().count()); if *p == pp { - let pos = self.stream.offset(); - self.stream.set(pos + pp.len()); + self.stream.increment(pp.len()); if self.config.with_whitespace.groups { self.stream.take_while(|s| s.is_whitespace());