Skip to content

collections: Put import behind cfg#198

Merged
febo merged 1 commit into
solana-program:mainfrom
febo:unused-import-warning
Jul 8, 2026
Merged

collections: Put import behind cfg#198
febo merged 1 commit into
solana-program:mainfrom
febo:unused-import-warning

Conversation

@febo

@febo febo commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Problem

There is a warning for unused import when building the collections.

warning: unused import: `from_utf8`
  --> src/str.rs:25:15
   |
25 |         str::{from_utf8, from_utf8_unchecked},
   |               ^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default

Solution

Put the import behind the features that use it.

@febo febo requested a review from joncinque July 8, 2026 17:40
Comment thread collections/src/str.rs
io::{ErrorKind, Read},
BorshDeserialize, BorshSerialize,
};
#[cfg(any(feature = "borsh", feature = "wincode"))]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

CI runs with --all-features so this is why it was not picked up.

@febo febo merged commit 91aed44 into solana-program:main Jul 8, 2026
53 checks passed
@febo febo deleted the unused-import-warning branch July 8, 2026 19:33
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