forked from solana-labs/solana
-
Notifications
You must be signed in to change notification settings - Fork 1k
cli: Resolve Rust 1.88 clippy lints and format strings #7089
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
dbc7bdf
Remove newlines, CLAP will wrap lines automatically
steviez affab6b
Break PROMPT into constant + skip formatting
steviez 0d9537c
Move specially crafted message to constant + add fmt skip
steviez 555494a
Move specially crafted string to const + fmt skip
steviez d99f008
Remove newlines, let CLAP wrap consistently
steviez a0daf8b
Remove some unnecessary newlines from asserts
steviez d5262a7
Move string out to apply rustfmt skip
steviez a1bca90
Move string to const to add rustfmt skip guard
steviez 0423db2
Run cargo clippy with Rust 1.88
steviez 40f9e4d
Run cargo fmt with format_strings = true
steviez 2e862fc
Add space between words
steviez 3e32f45
Manually wrap some > 100 char lines that are skipped by fmt
steviez ceeadf4
Manually format a string + add rustfmt::skip
steviez af0c37c
Cleanup very long string literal + add fmt skip
steviez 9a975cd
Remove duplicated string literal
steviez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -121,15 +121,17 @@ pub fn no_passphrase_and_message() -> (String, String) { | |
| pub fn acquire_passphrase_and_message( | ||
| matches: &ArgMatches, | ||
| ) -> Result<(String, String), Box<dyn error::Error>> { | ||
| #[rustfmt::skip] | ||
| const PROMPT: &str = | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I decided to leave this one as is as this is regularly displayed to users; on the other hand the adjustments to |
||
| "\nFor added security, enter a BIP39 passphrase\n\ | ||
| \nNOTE! This passphrase improves security of the recovery seed phrase NOT the\n\ | ||
| keypair file itself, which is stored as insecure plain text\n\ | ||
| \nBIP39 Passphrase (empty for none): "; | ||
|
|
||
| if matches.try_contains_id(NO_PASSPHRASE_ARG.name)? { | ||
| Ok(no_passphrase_and_message()) | ||
| } else { | ||
| match prompt_passphrase( | ||
| "\nFor added security, enter a BIP39 passphrase\n\ | ||
| \nNOTE! This passphrase improves security of the recovery seed phrase NOT the\n\ | ||
| keypair file itself, which is stored as insecure plain text\n\ | ||
| \nBIP39 Passphrase (empty for none): ", | ||
| ) { | ||
| match prompt_passphrase(PROMPT) { | ||
| Ok(passphrase) => { | ||
| println!(); | ||
| Ok((passphrase, " and your BIP39 passphrase".to_string())) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lol, deprecated in v1.18! Probably about time we remove them. (Not for this PR though.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I was going to start peeling this out but there is still some chain of usage so I did not pursue further