From e2c20840e4c22827aaa6c8453611f3f63c7706dd Mon Sep 17 00:00:00 2001 From: a1346054 <36859588+a1346054@users.noreply.github.com> Date: Wed, 25 Aug 2021 22:40:44 +0000 Subject: [PATCH] Fix spelling --- src/action/download.rs | 6 +++--- src/action/generate/completions.rs | 2 +- src/action/history.rs | 2 +- src/action/mod.rs | 2 +- src/action/upload.rs | 4 ++-- src/cmd/arg/gen_passphrase.rs | 2 +- src/cmd/arg/mod.rs | 2 +- src/cmd/matcher/upload.rs | 4 ++-- src/history.rs | 4 ++-- src/urlshorten.rs | 2 +- src/util.rs | 22 +++++++++++----------- 11 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/action/download.rs b/src/action/download.rs index 22604b7..39236fe 100644 --- a/src/action/download.rs +++ b/src/action/download.rs @@ -139,7 +139,7 @@ impl<'a> Download<'a> { { // Allocate an archive file, and update the download and target paths if extract { - // TODO: select the extention dynamically + // TODO: select the extension dynamically let archive_extention = ".tar"; // Allocate a temporary file to download the archive to @@ -210,7 +210,7 @@ impl<'a> Download<'a> { /// /// The full path including the name is returned. /// - /// This method will check whether a file is overwitten, and whether + /// This method will check whether a file is overwritten, and whether /// parent directories must be created. /// /// The program will quit with an error message if a problem occurs. @@ -313,7 +313,7 @@ impl<'a> Download<'a> { // Get the path string let path = target.to_str(); - // If the path is emtpy, use the working directory with the name hint + // If the path is empty, use the working directory with the name hint let use_workdir = path.map(|path| path.trim().is_empty()).unwrap_or(true); if use_workdir { match current_dir() { diff --git a/src/action/generate/completions.rs b/src/action/generate/completions.rs index c9299cf..370f691 100644 --- a/src/action/generate/completions.rs +++ b/src/action/generate/completions.rs @@ -24,7 +24,7 @@ impl<'a> Completions<'a> { let matcher_main = MainMatcher::with(self.cmd_matches).unwrap(); let matcher_completions = CompletionsMatcher::with(self.cmd_matches).unwrap(); - // Obtian shells to generate completions for, build application definition + // Obtain shells to generate completions for, build application definition let shells = matcher_completions.shells(); let dir = matcher_completions.output(); let quiet = matcher_main.quiet(); diff --git a/src/action/history.rs b/src/action/history.rs index 9c47436..f969fa9 100644 --- a/src/action/history.rs +++ b/src/action/history.rs @@ -63,7 +63,7 @@ impl<'a> History<'a> { // Remove history item if let Some(url) = matcher_history.rm() { - // Remove item, print error if no item with URL was foudn + // Remove item, print error if no item with URL was found match history.remove_url(url) { Ok(removed) if !removed => quit_error_msg( "could not remove item from history, no item matches given URL", diff --git a/src/action/mod.rs b/src/action/mod.rs index f2e65e8..32dd7c5 100644 --- a/src/action/mod.rs +++ b/src/action/mod.rs @@ -50,7 +50,7 @@ fn select_api_version( )); } - // Propegate other errors + // Propagate other errors Err(e) => return Err(e), } diff --git a/src/action/upload.rs b/src/action/upload.rs index a59e487..9366421 100644 --- a/src/action/upload.rs +++ b/src/action/upload.rs @@ -224,7 +224,7 @@ impl<'a> Upload<'a> { // Finish the archival process, writes the archive file archiver.finish().map_err(ArchiveError::Write)?; - // Append archive extention to name, set to upload archived file + // Append archive extension to name, set to upload archived file if let Some(ref mut file_name) = file_name { file_name.push_str(archive_extention); } @@ -275,7 +275,7 @@ impl<'a> Upload<'a> { // TODO: set false parameter to authentication state let max_size = upload_size_max(api_version, auth); - // Get the file size, fail on emtpy files, warn about large files + // Get the file size, fail on empty files, warn about large files if let Ok(size) = path.metadata().map(|m| m.len()) { // Enforce files not being 0 bytes if size == 0 && !matcher_main.force() { diff --git a/src/cmd/arg/gen_passphrase.rs b/src/cmd/arg/gen_passphrase.rs index 0bc8957..9e83cc1 100644 --- a/src/cmd/arg/gen_passphrase.rs +++ b/src/cmd/arg/gen_passphrase.rs @@ -11,7 +11,7 @@ pub struct ArgGenPassphrase {} impl ArgGenPassphrase { /// Generate a cryptographically secure passphrase that is easily - /// rememberable using diceware. + /// remembered using diceware. pub fn gen_passphrase() -> String { let mut config = BasicConfig::default(); config.words = PASSPHRASE_WORDS; diff --git a/src/cmd/arg/mod.rs b/src/cmd/arg/mod.rs index 9c5ca46..3878a95 100644 --- a/src/cmd/arg/mod.rs +++ b/src/cmd/arg/mod.rs @@ -8,7 +8,7 @@ pub mod owner; pub mod password; pub mod url; -// Re-eexport to arg module +// Re-export to arg module pub use self::api::ArgApi; pub use self::basic_auth::ArgBasicAuth; pub use self::download_limit::ArgDownloadLimit; diff --git a/src/cmd/matcher/upload.rs b/src/cmd/matcher/upload.rs index d0c1e33..3562ca3 100644 --- a/src/cmd/matcher/upload.rs +++ b/src/cmd/matcher/upload.rs @@ -35,7 +35,7 @@ impl<'a: 'b, 'b> UploadMatcher<'a> { let name = self.matches.value_of("name")?; // The file name must not be empty - // TODO: allow to force an empty name here, and process emtpy names on downloading + // TODO: allow to force an empty name here, and process empty names on downloading if name.trim().is_empty() { quit_error_msg( "the file name must not be empty", @@ -171,7 +171,7 @@ pub enum CopyMode { } impl CopyMode { - /// Build the string to copy, based on the given `url` and currend mode. + /// Build the string to copy, based on the given `url` and current mode. pub fn build(&self, url: &str) -> String { match self { CopyMode::Url => url.into(), diff --git a/src/history.rs b/src/history.rs index b6d9060..dec3d8a 100644 --- a/src/history.rs +++ b/src/history.rs @@ -21,7 +21,7 @@ const VERSION_MAX: &str = crate_version!(); #[derive(Serialize, Deserialize)] pub struct History { /// The application version the history file was built with. - /// Used for compatability checking. + /// Used for compatibility checking. version: Option, /// The file history. @@ -224,7 +224,7 @@ impl History { /// /// If the expiry property is None (thus unknown), the file will be kept. /// - /// The number of exired files is returned. + /// The number of expired files is returned. pub fn gc(&mut self) -> usize { // Get a list of expired files let expired: Vec = self diff --git a/src/urlshorten.rs b/src/urlshorten.rs index 9af73d4..67a8694 100644 --- a/src/urlshorten.rs +++ b/src/urlshorten.rs @@ -76,7 +76,7 @@ pub enum Error { #[fail(display = "failed to shorten URL, got bad response")] Response(#[cause] ResponseError), - /// The server resonded with a malformed repsonse. + /// The server responded with a malformed response. #[fail(display = "failed to shorten URL, got malformed response")] Malformed(#[cause] reqwest::Error), diff --git a/src/util.rs b/src/util.rs index ef93732..a79737d 100644 --- a/src/util.rs +++ b/src/util.rs @@ -291,13 +291,13 @@ pub fn highlight_info(msg: &str) -> ColoredString { } /// Open the given URL in the users default browser. -/// The browsers exit statis is returned. +/// The browsers exit status is returned. pub fn open_url(url: impl Borrow) -> Result { open_path(url.borrow().as_str()) } /// Open the given path or URL using the program configured on the system. -/// The program exit statis is returned. +/// The program exit status is returned. pub fn open_path(path: &str) -> Result { open::that(path) } @@ -318,7 +318,7 @@ pub fn set_clipboard(content: String) -> Result<(), ClipboardError> { /// native clipboard interface only has a lifetime of the application. This means that the /// clipboard is instantly cleared as soon as this application quits, which is always immediately. /// This limitation is due to security reasons as defined by X11. The alternative binaries we set -/// the clipboard with spawn a daemon in the background to keep the clipboad alive until it's +/// the clipboard with spawn a daemon in the background to keep the clipboard alive until it's /// flushed. #[cfg(feature = "clipboard")] #[derive(Clone, Eq, PartialEq)] @@ -491,7 +491,7 @@ pub enum ClipboardError { #[fail(display = "failed to access clipboard using {}", _0)] BinaryIo(&'static str, #[cause] IoError), - /// `xclip` or `xsel` unexpectetly exited with a non-successful status code. + /// `xclip` or `xsel` unexpectedly exited with a non-successful status code. #[cfg(feature = "clipboard-bin")] #[fail( display = "failed to use clipboard, {} exited with status code {}", @@ -500,8 +500,8 @@ pub enum ClipboardError { BinaryStatus(&'static str, i32), } -/// Check for an emtpy password in the given `password`. -/// If the password is emtpy the program will quit with an error unless +/// Check for an empty password in the given `password`. +/// If the password is empty the program will quit with an error unless /// forced. // TODO: move this to a better module pub fn check_empty_password(password: &str, matcher_main: &MainMatcher) { @@ -519,7 +519,7 @@ pub fn check_empty_password(password: &str, matcher_main: &MainMatcher) { /// Prompt the user to enter a password. /// -/// If `empty` is `false`, emtpy passwords aren't allowed unless forced. +/// If `empty` is `false`, empty passwords aren't allowed unless forced. pub fn prompt_password(main_matcher: &MainMatcher, optional: bool) -> Option { // Quit with an error if we may not interact if !optional && main_matcher.no_interact() { @@ -549,7 +549,7 @@ pub fn prompt_password(main_matcher: &MainMatcher, optional: bool) -> Option { if !optional { quit_error( @@ -592,7 +592,7 @@ pub fn ensure_password( return false; } - // Check whehter we allow interaction + // Check whether we allow interaction let interact = !main_matcher.no_interact(); loop { @@ -761,7 +761,7 @@ pub fn ensure_owner_token( main_matcher: &MainMatcher, optional: bool, ) -> bool { - // Check whehter we allow interaction + // Check whether we allow interaction let interact = !main_matcher.no_interact(); // Notify that an owner token is required @@ -984,7 +984,7 @@ pub fn ensure_enough_space>(path: P, size: u64) { } }; - // Return if enough disk space is avaiable + // Return if enough disk space is available if space >= size { return; }