Skip to content

Commit

Permalink
clipboard: run cargo +nightly fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
rzmk committed Jul 14, 2024
1 parent 0ee2de9 commit 89b8066
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions src/cmd/clipboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,28 @@ struct Args {
impl From<arboard::Error> for CliError {
fn from(err: arboard::Error) -> Self {
match err {
arboard::Error::ClipboardNotSupported => {
CliError::Other(format!("The clipboard may not be supported for the current environment."))
},
arboard::Error::ConversionFailure => {
CliError::Other(format!("The content that was about the be transferred to/from the clipboard could not be converted to the appropriate format."))
},
arboard::Error::ClipboardOccupied => {
CliError::Other(format!("The clipboard was unaccessible when attempting to access/use it. It may have been held by another process/thread."))
},
arboard::Error::ContentNotAvailable => {
CliError::Other(format!("The clipboard contents were not available in the requested format. This could either be due to the clipboard being empty or the clipboard contents having an incompatible format to the requested one."))
},
arboard::Error::Unknown { description: _ } => {
CliError::Other(format!("An unknown error occurred while attempting to use the clipboard."))
},
_ => {
CliError::Other(format!("An unexpected error occurred while using the clipboard."))
}
arboard::Error::ClipboardNotSupported => CliError::Other(format!(
"The clipboard may not be supported for the current environment."
)),

Check warning

Code scanning / clippy

useless use of format! Warning

useless use of format!
arboard::Error::ConversionFailure => CliError::Other(format!(
"The content that was about the be transferred to/from the clipboard could not be \
converted to the appropriate format."
)),

Check warning

Code scanning / clippy

useless use of format! Warning

useless use of format!
arboard::Error::ClipboardOccupied => CliError::Other(format!(
"The clipboard was unaccessible when attempting to access/use it. It may have \
been held by another process/thread."
)),

Check warning

Code scanning / clippy

useless use of format! Warning

useless use of format!
arboard::Error::ContentNotAvailable => CliError::Other(format!(
"The clipboard contents were not available in the requested format. This could \
either be due to the clipboard being empty or the clipboard contents having an \
incompatible format to the requested one."
)),

Check warning

Code scanning / clippy

useless use of format! Warning

useless use of format!
arboard::Error::Unknown { description: _ } => CliError::Other(format!(
"An unknown error occurred while attempting to use the clipboard."
)),

Check warning

Code scanning / clippy

useless use of format! Warning

useless use of format!
_ => CliError::Other(format!(
"An unexpected error occurred while using the clipboard."
)),

Check warning

Code scanning / clippy

useless use of format! Warning

useless use of format!
}
}
}
Expand Down

0 comments on commit 89b8066

Please sign in to comment.