Skip to content

Comments

chore(rustc): bump workspace to rust 2024 edition#539

Merged
XAMPPRocky merged 11 commits intolibrasn:mainfrom
mkatychev:chore/rust-2024
Feb 19, 2026
Merged

chore(rustc): bump workspace to rust 2024 edition#539
XAMPPRocky merged 11 commits intolibrasn:mainfrom
mkatychev:chore/rust-2024

Conversation

@mkatychev
Copy link
Contributor

@mkatychev mkatychev commented Feb 18, 2026

Ran:

  • cargo clippy --fix --workspace
  • cargo fmt

Fixed a few clippy warnings originating in rasn-derive

Comment on lines +543 to +550
// Use shorthand syntax for named fields; unnamed fields use full form
if let Some(field_ident) = field.ident.as_ref() {
(quote!(#field_ident), quote!(#field_ident))
} else {
let index = syn::Index::from(i);
let ident = format_ident!("i{}", index);
(quote!(#index: #ident), quote!(#index: #ident))
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous approach triggered https://doc.rust-lang.org/stable/nightly-rustc/rustc_lint/builtin/static.NON_SHORTHAND_FIELD_PATTERNS.html
when using (quote!(#name : ref #ident), quote!(#name : #ident)) in places such as

rasn/tests/explicit.rs

Lines 71 to 73 in 6c25ecb

pub enum WrappedChoice {
Sequence { b: bool },
}

happy to revert and make it an allow(

impl TypeExt for syn::Type {
fn strip_lifetimes(&mut self) {
if let syn::Type::Reference(ref mut reference) = self {
if let syn::Type::Reference(reference) = self {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was triggering cannot explicitly borrow within an implicitly-borrowing pattern in here:

#[derive(AsnType, Clone, Debug, Decode, Encode, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[rasn(tag(explicit(application, 1)))]
#[rasn(choice)]
pub enum CountryName {
#[rasn(size(3))]
X121DccCode(NumericString),
#[rasn(size(2))]
Iso3166Alpha2Code(PrintableString),
}

@mkatychev mkatychev marked this pull request as ready for review February 18, 2026 17:41
@XAMPPRocky
Copy link
Collaborator

Thank you for your PR, and congrats on your first contribution! 🎉

@XAMPPRocky XAMPPRocky merged commit 4401ff9 into librasn:main Feb 19, 2026
44 checks passed
This was referenced Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants