fix some warnings

This commit is contained in:
mat 2023-05-05 17:15:49 +00:00
parent 3702b2cb21
commit df167a5a39
4 changed files with 7 additions and 5 deletions

View file

@ -26,7 +26,7 @@ pub fn generate(input: &DeclareMenus) -> TokenStream {
name_snake_case.span(),
);
let enum_name = Ident::new(
&format!("{}MenuLocation", variant_name),
&format!("{variant_name}MenuLocation"),
variant_name.span(),
);
menu_location_variants.extend(quote! {

View file

@ -406,13 +406,13 @@ fn generate_menu_consts(menu: &Menu) -> TokenStream {
if field.length == 1 {
let field_name = Ident::new(
format!("{}_SLOT", field_name_start).as_str(),
format!("{field_name_start}_SLOT").as_str(),
field.name.span(),
);
menu_consts.extend(quote! { pub const #field_name: usize = #field_index_start; });
} else {
let field_name = Ident::new(
format!("{}_SLOTS", field_name_start).as_str(),
format!("{field_name_start}_SLOTS").as_str(),
field.name.span(),
);
menu_consts.extend(quote! { pub const #field_name: RangeInclusive<usize> = #field_index_start..=#field_index_end; });

View file

@ -3,6 +3,8 @@ pub trait MaxStackSizeExt {
///
/// This is a signed integer to be consistent with the `count` field of
/// [`ItemSlotData`].
///
/// [`ItemSlotData`]: crate::ItemSlotData
fn max_stack_size(&self) -> i8;
/// Whether this item can be stacked with other items.

View file

@ -25,8 +25,8 @@ pub trait ContainerClientExt {
}
impl ContainerClientExt for Client {
/// Open a container in the world, like a chest. Use [`Client::inventory`]
/// to open your own inventory.
/// Open a container in the world, like a chest. Use
/// [`Client::open_inventory`] to open your own inventory.
///
/// ```
/// # use azalea::prelude::*;