Skip to content

Commit d25431c

Browse files
committed
Use 3rd person tense for function docs
As is typical in the Rust ecosystem use the third person tense when documenting functions. E.g., ``` /// Creates a new Foo. ``` As opposed to ``` /// Create a new Foo. ```
1 parent c3be285 commit d25431c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/ecdh.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,35 +54,35 @@ impl_from_array_len!(SharedSecret, 256, (16 20 28 32 48 64 96 128 256));
5454

5555
impl SharedSecret {
5656

57-
/// Create an empty SharedSecret
57+
/// Creates an empty `SharedSecret`.
5858
pub(crate) fn empty() -> SharedSecret {
5959
SharedSecret {
6060
data: [0u8; 256],
6161
len: 0,
6262
}
6363
}
6464

65-
/// Get a pointer to the underlying data with the specified capacity.
65+
/// Gets a pointer to the underlying data with the specified capacity.
6666
pub(crate) fn get_data_mut_ptr(&mut self) -> *mut u8 {
6767
self.data.as_mut_ptr()
6868
}
6969

70-
/// Get the capacity of the underlying data buffer.
70+
/// Gets the capacity of the underlying data buffer.
7171
pub fn capacity(&self) -> usize {
7272
self.data.len()
7373
}
7474

75-
/// Get the len of the used data.
75+
/// Gets the len of the used data.
7676
pub fn len(&self) -> usize {
7777
self.len
7878
}
7979

80-
/// True if the underlying data buffer is empty.
80+
/// Returns true if the underlying data buffer is empty.
8181
pub fn is_empty(&self) -> bool {
8282
self.data.is_empty()
8383
}
8484

85-
/// Set the length of the object.
85+
/// Sets the length of the object.
8686
pub(crate) fn set_len(&mut self, len: usize) {
8787
debug_assert!(len <= self.data.len());
8888
self.len = len;
@@ -116,7 +116,7 @@ unsafe extern "C" fn c_callback(output: *mut c_uchar, x: *const c_uchar, y: *con
116116
}
117117

118118
impl SharedSecret {
119-
/// Creates a new shared secret from a pubkey and secret key
119+
/// Creates a new shared secret from a pubkey and secret key.
120120
#[inline]
121121
pub fn new(point: &PublicKey, scalar: &SecretKey) -> SharedSecret {
122122
let mut ss = SharedSecret::empty();
@@ -138,7 +138,7 @@ impl SharedSecret {
138138
}
139139

140140

141-
/// Creates a new shared secret from a pubkey and secret key with applied custom hash function
141+
/// Creates a new shared secret from a pubkey and secret key with applied custom hash function.
142142
/// The custom hash function must be in the form of `fn(x: [u8;32], y: [u8;32]) -> SharedSecret`
143143
/// `SharedSecret` can be easily created via the `From` impl from arrays.
144144
/// # Examples

0 commit comments

Comments
 (0)