Skip to content

Commit

Permalink
Spell check docs
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede authored and complexspaces committed Dec 29, 2023
1 parent a100f2d commit 0d6725d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub enum Error {
///
/// - When returned from `set_image`: the image going to the clipboard cannot be converted to the appropriate format.
/// - When returned from `get_image`: the image coming from the clipboard could not be converted into the `ImageData` struct.
/// - When returned from `get_text`: the text coming from the clipboard is not valid utf-8 or cannot be converted to utf-8.
/// - When returned from `get_text`: the text coming from the clipboard is not valid UTF-8 or cannot be converted to UTF-8.
#[error("The image or the text that was about the be transferred to/from the clipboard could not be converted to the appropriate format.")]
ConversionFailure,

Expand Down
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub use platform::SetExtWindows;
/// The clipboard on Windows is a global object, which may only be opened on one thread at once.
/// This means that `arboard` only truly opens the clipboard during each operation to ensure that
/// multiple `Clipboard`'s may exist at once. This also means that attempting operations in parallel
/// has a high likelyhood to return an error instead.
/// has a high likelihood to return an error instead.
#[allow(rustdoc::broken_intra_doc_links)]
pub struct Clipboard {
pub(crate) platform: platform::Clipboard,
Expand All @@ -68,19 +68,19 @@ impl Clipboard {
Ok(Clipboard { platform: platform::Clipboard::new()? })
}

/// Fetches utf-8 text from the clipboard and returns it.
/// Fetches UTF-8 text from the clipboard and returns it.
pub fn get_text(&mut self) -> Result<String, Error> {
self.get().text()
}

/// Places the text onto the clipboard. Any valid utf-8 string is accepted.
/// Places the text onto the clipboard. Any valid UTF-8 string is accepted.
pub fn set_text<'a, T: Into<Cow<'a, str>>>(&mut self, text: T) -> Result<(), Error> {
self.set().text(text)
}

/// Places the HTML as well as a plain-text alternative onto the clipboard.
///
/// Any valid utf-8 string is accepted.
/// Any valid UTF-8 string is accepted.
pub fn set_html<'a, T: Into<Cow<'a, str>>>(
&mut self,
html: T,
Expand Down Expand Up @@ -304,7 +304,7 @@ mod tests {
ctx.set_text("clipboard test").unwrap();
assert!(matches!(ctx.get_image(), Err(Error::ContentNotAvailable)));

// Test if we get the same image that we put onto the clibboard
// Test if we get the same image that we put onto the clipboard
ctx.set_image(img_data.clone()).unwrap();
let got = ctx.get_image().unwrap();
assert_eq!(img_data.bytes, got.bytes);
Expand Down
2 changes: 1 addition & 1 deletion src/platform/linux/x11.rs
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ fn serve_requests(context: Arc<Inner>) -> Result<(), Box<dyn std::error::Error>>
log::trace!("Finishing clipboard manager handover.");
*handover_state = ManagerHandoverState::Finished;

// Not sure if unlocking the mutext is necessary here but better safe than sorry.
// Not sure if unlocking the mutex is necessary here but better safe than sorry.
drop(handover_state);

clip.handover_cv.notify_all();
Expand Down

0 comments on commit 0d6725d

Please sign in to comment.