-
Notifications
You must be signed in to change notification settings - Fork 5
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
docs: fix typos and spelling errors #100
Merged
Merged
Changes from all commits
Commits
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 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 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 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 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 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//! Representation of itegers in the JSONPath specification | ||
//! Representation of integers in the JSONPath specification | ||
//! | ||
//! The JSONPath specification defines some rules for integers used in query strings (see [here][spec]). | ||
//! | ||
|
@@ -11,7 +11,7 @@ use std::{ | |
|
||
/// An integer for internet JSON ([RFC7493][ijson]) | ||
/// | ||
/// The value must be within the range [-(2<sup>53</sup>)+1, (2<sup>53</sup>)-1]). | ||
/// The value must be within the range [-(2<sup>53</sup>)+1, (2<sup>53</sup>)-1]. | ||
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 assume the trailing 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. Yep, that's a typo! |
||
/// | ||
/// [ijson]: https://www.rfc-editor.org/rfc/rfc7493#section-2.2 | ||
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] | ||
|
@@ -47,34 +47,34 @@ impl Integer { | |
/// # Panics | ||
/// | ||
/// This will panic if the inputted value is out of the valid range | ||
/// [-(2<sup>53</sup>)+1, (2<sup>53</sup>)-1]). | ||
/// [-(2<sup>53</sup>)+1, (2<sup>53</sup>)-1]. | ||
pub fn from_i64_unchecked(value: i64) -> Self { | ||
Self::try_new(value).expect("value is out of the valid range") | ||
} | ||
|
||
/// Take the absolute value, producing `None` if the resulting value is outside | ||
/// the valid range [-(2<sup>53</sup>)+1, (2<sup>53</sup>)-1]). | ||
/// the valid range [-(2<sup>53</sup>)+1, (2<sup>53</sup>)-1]. | ||
pub fn checked_abs(mut self) -> Option<Self> { | ||
self.0 = self.0.checked_abs()?; | ||
self.check().then_some(self) | ||
} | ||
|
||
/// Add the two values, producing `None` if the resulting value is outside the | ||
/// valid range [-(2<sup>53</sup>)+1, (2<sup>53</sup>)-1]). | ||
/// valid range [-(2<sup>53</sup>)+1, (2<sup>53</sup>)-1]. | ||
pub fn checked_add(mut self, rhs: Self) -> Option<Self> { | ||
self.0 = self.0.checked_add(rhs.0)?; | ||
self.check().then_some(self) | ||
} | ||
|
||
/// Subtract the `rhs` from `self`, producing `None` if the resulting value is | ||
/// outside the valid range [-(2<sup>53</sup>)+1, (2<sup>53</sup>)-1]). | ||
/// outside the valid range [-(2<sup>53</sup>)+1, (2<sup>53</sup>)-1]. | ||
pub fn checked_sub(mut self, rhs: Self) -> Option<Self> { | ||
self.0 = self.0.checked_sub(rhs.0)?; | ||
self.check().then_some(self) | ||
} | ||
|
||
/// Multiply the two values, producing `None` if the resulting value is outside | ||
/// the valid range [-(2<sup>53</sup>)+1, (2<sup>53</sup>)-1]). | ||
/// the valid range [-(2<sup>53</sup>)+1, (2<sup>53</sup>)-1]. | ||
pub fn checked_mul(mut self, rhs: Self) -> Option<Self> { | ||
self.0 = self.0.checked_mul(rhs.0)?; | ||
self.check().then_some(self) | ||
|
@@ -136,7 +136,7 @@ impl PartialOrd<i64> for Integer { | |
/// An error for the [`Integer`] type | ||
#[derive(Debug, thiserror::Error)] | ||
pub enum IntegerError { | ||
/// The provided value was outside the valid range [-(2**53)+1, (2**53)-1]) | ||
/// The provided value was outside the valid range [-(2**53)+1, (2**53)-1] | ||
#[error("the provided integer was outside the valid range, see https://www.rfc-editor.org/rfc/rfc9535.html#section-2.1-4.1")] | ||
OutOfBounds, | ||
/// Integer parsing error | ||
|
This file contains 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 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
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.
Not sure if you prefer British or American English spelling; but at least
CODE_OF_CONDUCT.md
was consistently using "behavior".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.
I am Canadian, so I tend to use the British spelling, but I am impartial and will accept this 😄