Skip to content

Commit cc78897

Browse files
committed
docs: simplify documentation
1 parent ce629a5 commit cc78897

File tree

18 files changed

+15
-241
lines changed

18 files changed

+15
-241
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

postgresql_archive/src/archive.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@ pub const DEFAULT_POSTGRESQL_URL: &str = "https://github.com/theseus-rs/postgres
2222
/// Gets the version for the specified [version requirement](VersionReq). If a version for the
2323
/// [version requirement](VersionReq) is not found, then an error is returned.
2424
///
25-
/// # Arguments
26-
/// * `url` - The URL to released archives.
27-
/// * `version_req` - The version requirement.
28-
///
29-
/// # Returns
30-
/// * The version matching the requirement.
31-
///
3225
/// # Errors
3326
/// * If the version is not found.
3427
#[instrument(level = "debug")]
@@ -42,13 +35,6 @@ pub async fn get_version(url: &str, version_req: &VersionReq) -> Result<Version>
4235
/// matcher. If no archive is found for the [version requirement](VersionReq) and matcher then
4336
/// an [error](crate::error::Error) is returned.
4437
///
45-
/// # Arguments
46-
/// * `url` - The URL to the archive resources.
47-
/// * `version_req` - The version requirement.
48-
///
49-
/// # Returns
50-
/// * The archive version and bytes.
51-
///
5238
/// # Errors
5339
/// * If the archive is not found.
5440
/// * If the archive cannot be downloaded.
@@ -65,12 +51,6 @@ pub async fn get_archive(url: &str, version_req: &VersionReq) -> Result<(Version
6551
/// Acquires a lock file in the [out_dir](Path) to prevent multiple processes from extracting the
6652
/// archive at the same time.
6753
///
68-
/// # Arguments
69-
/// * `out_dir` - The directory to extract the archive to.
70-
///
71-
/// # Returns
72-
/// * The lock file.
73-
///
7454
/// # Errors
7555
/// * If the lock file cannot be acquired.
7656
#[instrument(level = "debug")]
@@ -119,13 +99,6 @@ fn acquire_lock(out_dir: &Path) -> Result<PathBuf> {
11999

120100
/// Extracts the compressed tar [bytes](Bytes) to the [out_dir](Path).
121101
///
122-
/// # Arguments
123-
/// * `bytes` - The compressed tar bytes.
124-
/// * `out_dir` - The directory to extract the tar to.
125-
///
126-
/// # Returns
127-
/// * The extracted files.
128-
///
129102
/// # Errors
130103
/// Returns an error if the extraction fails.
131104
#[allow(clippy::cast_precision_loss)]

postgresql_archive/src/blocking/archive.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,6 @@ lazy_static! {
1010
/// Gets the version for the specified [version requirement](VersionReq). If a version for the
1111
/// [version requirement](VersionReq) is not found, then an error is returned.
1212
///
13-
/// # Arguments
14-
/// * `url` - The URL to released archives.
15-
/// * `version_req` - The version requirement.
16-
///
17-
/// # Returns
18-
/// * The version matching the requirement.
19-
///
2013
/// # Errors
2114
/// * If the version is not found.
2215
pub fn get_version(url: &str, version_req: &VersionReq) -> crate::Result<Version> {
@@ -29,13 +22,6 @@ pub fn get_version(url: &str, version_req: &VersionReq) -> crate::Result<Version
2922
/// matcher. If no archive is found for the [version requirement](VersionReq) and matcher then
3023
/// an [error](crate::error::Error) is returned.
3124
///
32-
/// # Arguments
33-
/// * `url` - The URL to the archive resources.
34-
/// * `version_req` - The version requirement.
35-
///
36-
/// # Returns
37-
/// * The archive version and bytes.
38-
///
3925
/// # Errors
4026
/// * If the archive is not found.
4127
/// * If the archive cannot be downloaded.
@@ -47,13 +33,6 @@ pub fn get_archive(url: &str, version_req: &VersionReq) -> crate::Result<(Versio
4733

4834
/// Extracts the compressed tar [bytes](Bytes) to the [out_dir](Path).
4935
///
50-
/// # Arguments
51-
/// * `bytes` - The compressed tar bytes.
52-
/// * `out_dir` - The directory to extract the tar to.
53-
///
54-
/// # Returns
55-
/// * The extracted files.
56-
///
5736
/// # Errors
5837
/// Returns an error if the extraction fails.
5938
pub fn extract(bytes: &Bytes, out_dir: &Path) -> crate::Result<()> {

postgresql_archive/src/hasher/blake2b_512.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ use blake2::{Blake2b512, Digest};
33

44
/// Hashes the data using blake2b-512.
55
///
6-
/// # Arguments
7-
/// * `data` - The data to hash.
8-
///
9-
/// # Returns
10-
/// * The hash of the data.
11-
///
126
/// # Errors
137
/// * If the data cannot be hashed.
148
pub fn hash(data: &Vec<u8>) -> Result<String> {

postgresql_archive/src/hasher/blake2s_256.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ use blake2::{Blake2s256, Digest};
33

44
/// Hashes the data using blake2s-256.
55
///
6-
/// # Arguments
7-
/// * `data` - The data to hash.
8-
///
9-
/// # Returns
10-
/// * The hash of the data.
11-
///
126
/// # Errors
137
/// * If the data cannot be hashed.
148
pub fn hash(data: &Vec<u8>) -> Result<String> {

postgresql_archive/src/hasher/registry.rs

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ struct HasherRegistry {
1818

1919
impl HasherRegistry {
2020
/// Creates a new hasher registry.
21-
///
22-
/// # Returns
23-
/// * The hasher registry.
2421
fn new() -> Self {
2522
Self {
2623
hashers: HashMap::new(),
@@ -29,23 +26,13 @@ impl HasherRegistry {
2926

3027
/// Registers a hasher for an extension. Newly registered hashers with the same extension will
3128
/// override existing ones.
32-
///
33-
/// # Arguments
34-
/// * `extension` - The extension to register the hasher for.
35-
/// * `hasher_fn` - The hasher function to register.
3629
fn register<S: AsRef<str>>(&mut self, extension: S, hasher_fn: HasherFn) {
3730
let extension = extension.as_ref().to_string();
3831
self.hashers
3932
.insert(extension, Arc::new(RwLock::new(hasher_fn)));
4033
}
4134

4235
/// Get a hasher for the specified extension.
43-
///
44-
/// # Arguments
45-
/// * `extension` - The extension to locate a hasher for.
46-
///
47-
/// # Returns
48-
/// * The hasher for the extension or [None] if not found.
4936
fn get<S: AsRef<str>>(&self, extension: S) -> Option<HasherFn> {
5037
let extension = extension.as_ref().to_string();
5138
if let Some(hasher) = self.hashers.get(&extension) {
@@ -57,6 +44,7 @@ impl HasherRegistry {
5744
}
5845

5946
impl Default for HasherRegistry {
47+
/// Creates a new hasher registry with the default hashers registered.
6048
fn default() -> Self {
6149
let mut registry = Self::new();
6250
registry.register("blake2s", blake2s_256::hash);
@@ -72,10 +60,6 @@ impl Default for HasherRegistry {
7260
/// Registers a hasher for an extension. Newly registered hashers with the same extension will
7361
/// override existing ones.
7462
///
75-
/// # Arguments
76-
/// * `extension` - The extension to register the hasher for.
77-
/// * `hasher_fn` - The hasher function to register.
78-
///
7963
/// # Panics
8064
/// * If the registry is poisoned.
8165
#[allow(dead_code)]
@@ -86,12 +70,6 @@ pub fn register<S: AsRef<str>>(extension: S, hasher_fn: HasherFn) {
8670

8771
/// Get a hasher for the specified extension.
8872
///
89-
/// # Arguments
90-
/// * `extension` - The extension to locate a hasher for.
91-
///
92-
/// # Returns
93-
/// * The hasher for the extension or [None] if not found.
94-
///
9573
/// # Panics
9674
/// * If the registry is poisoned.
9775
pub fn get<S: AsRef<str>>(extension: S) -> Option<HasherFn> {

postgresql_archive/src/hasher/sha2_256.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ use sha2::{Digest, Sha256};
33

44
/// Hashes the data using SHA2-256.
55
///
6-
/// # Arguments
7-
/// * `data` - The data to hash.
8-
///
9-
/// # Returns
10-
/// * The hash of the data.
11-
///
126
/// # Errors
137
/// * If the data cannot be hashed.
148
pub fn hash(data: &Vec<u8>) -> Result<String> {

postgresql_archive/src/hasher/sha2_512.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ use sha2::{Digest, Sha512};
33

44
/// Hashes the data using SHA2-512.
55
///
6-
/// # Arguments
7-
/// * `data` - The data to hash.
8-
///
9-
/// # Returns
10-
/// * The hash of the data.
11-
///
126
/// # Errors
137
/// * If the data cannot be hashed.
148
pub fn hash(data: &Vec<u8>) -> Result<String> {

postgresql_archive/src/hasher/sha3_256.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ use sha3::{Digest, Sha3_256};
33

44
/// Hashes the data using SHA3-256.
55
///
6-
/// # Arguments
7-
/// * `data` - The data to hash.
8-
///
9-
/// # Returns
10-
/// * The hash of the data.
11-
///
126
/// # Errors
137
/// * If the data cannot be hashed.
148
pub fn hash(data: &Vec<u8>) -> Result<String> {

postgresql_archive/src/hasher/sha3_512.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ use sha3::{Digest, Sha3_512};
33

44
/// Hashes the data using SHA3-512.
55
///
6-
/// # Arguments
7-
/// * `data` - The data to hash.
8-
///
9-
/// # Returns
10-
/// * The hash of the data.
11-
///
126
/// # Errors
137
/// * If the data cannot be hashed.
148
pub fn hash(data: &Vec<u8>) -> Result<String> {

0 commit comments

Comments
 (0)