Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cc78897

Browse filesBrowse files
committed
docs: simplify documentation
1 parent ce629a5 commit cc78897
Copy full SHA for cc78897

File tree

Expand file treeCollapse file tree

18 files changed

+15
-241
lines changed
Filter options
Expand file treeCollapse file tree

18 files changed

+15
-241
lines changed

‎Cargo.lock

Copy file name to clipboardExpand all lines: Cargo.lock
+2-2Lines 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

Copy file name to clipboardExpand all lines: postgresql_archive/src/archive.rs
-27Lines 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

Copy file name to clipboardExpand all lines: postgresql_archive/src/blocking/archive.rs
-21Lines 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

Copy file name to clipboardExpand all lines: postgresql_archive/src/hasher/blake2b_512.rs
-6Lines 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

Copy file name to clipboardExpand all lines: postgresql_archive/src/hasher/blake2s_256.rs
-6Lines 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

Copy file name to clipboardExpand all lines: postgresql_archive/src/hasher/registry.rs
+1-23Lines 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

Copy file name to clipboardExpand all lines: postgresql_archive/src/hasher/sha2_256.rs
-6Lines 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

Copy file name to clipboardExpand all lines: postgresql_archive/src/hasher/sha2_512.rs
-6Lines 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

Copy file name to clipboardExpand all lines: postgresql_archive/src/hasher/sha3_256.rs
-6Lines 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

Copy file name to clipboardExpand all lines: postgresql_archive/src/hasher/sha3_512.rs
-6Lines 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> {

‎postgresql_archive/src/matcher/default.rs

Copy file name to clipboardExpand all lines: postgresql_archive/src/matcher/default.rs
-7Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@ use std::env;
55
/// Default asset matcher that matches the asset name to the current target triple or OS/CPU
66
/// architecture.
77
///
8-
/// # Arguments
9-
/// * `name` - The name of the asset.
10-
/// * `version` - The version of the asset.
11-
///
12-
/// # Returns
13-
/// * Whether the asset matches.
14-
///
158
/// # Errors
169
/// * If the asset matcher fails.
1710
pub fn matcher(name: &str, _version: &Version) -> crate::Result<bool> {

‎postgresql_archive/src/matcher/postgresql_binaries.rs

Copy file name to clipboardExpand all lines: postgresql_archive/src/matcher/postgresql_binaries.rs
-7Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@ use semver::Version;
22

33
/// Matcher for PostgreSQL binaries from <https://github.com/theseus-rs/postgresql-binaries>
44
///
5-
/// # Arguments
6-
/// * `name` - The name of the asset.
7-
/// * `version` - The version of the asset.
8-
///
9-
/// # Returns
10-
/// * Whether the asset matches.
11-
///
125
/// # Errors
136
/// * If the asset matcher fails.
147
#[allow(clippy::unnecessary_wraps)]

‎postgresql_archive/src/matcher/registry.rs

Copy file name to clipboardExpand all lines: postgresql_archive/src/matcher/registry.rs
+1-23Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ struct MatchersRegistry {
1919

2020
impl MatchersRegistry {
2121
/// Creates a new matcher registry.
22-
///
23-
/// # Returns
24-
/// * The matcher registry.
2522
fn new() -> Self {
2623
Self {
2724
matchers: HashMap::new(),
@@ -30,23 +27,13 @@ impl MatchersRegistry {
3027

3128
/// Registers a matcher for a URL. Newly registered matchers with the same url will override
3229
/// existing ones.
33-
///
34-
/// # Arguments
35-
/// * `url` - The URL to register the matcher for; [None] to register the default.
36-
/// * `matcher_fn` - The matcher function to register.
3730
fn register<S: AsRef<str>>(&mut self, url: Option<S>, matcher_fn: MatcherFn) {
3831
let url: Option<String> = url.map(|s| s.as_ref().to_string());
3932
self.matchers.insert(url, Arc::new(RwLock::new(matcher_fn)));
4033
}
4134

4235
/// Get a matcher for the specified URL, or the default matcher if no matcher is
4336
/// registered for the URL.
44-
///
45-
/// # Arguments
46-
/// * `url` - The URL to locate a matcher for.
47-
///
48-
/// # Returns
49-
/// * The matcher for the URL, or the default matcher.
5037
fn get<S: AsRef<str>>(&self, url: S) -> MatcherFn {
5138
let url = Some(url.as_ref().to_string());
5239
if let Some(matcher) = self.matchers.get(&url) {
@@ -61,6 +48,7 @@ impl MatchersRegistry {
6148
}
6249

6350
impl Default for MatchersRegistry {
51+
/// Creates a new matcher registry with the default matchers registered.
6452
fn default() -> Self {
6553
let mut registry = Self::new();
6654
registry.register(None::<&str>, default::matcher);
@@ -72,10 +60,6 @@ impl Default for MatchersRegistry {
7260
/// Registers a matcher for a URL. Newly registered matchers with the same url will override
7361
/// existing ones.
7462
///
75-
/// # Arguments
76-
/// * `url` - The URL to register the matcher for; [None] to register the default.
77-
/// * `matcher_fn` - The matcher function to register.
78-
///
7963
/// # Panics
8064
/// * If the registry is poisoned.
8165
#[allow(dead_code)]
@@ -87,12 +71,6 @@ pub fn register<S: AsRef<str>>(url: Option<S>, matcher_fn: MatcherFn) {
8771
/// Get a matcher for the specified URL, or the default matcher if no matcher is
8872
/// registered for the URL.
8973
///
90-
/// # Arguments
91-
/// * `url` - The URL to locate a matcher for.
92-
///
93-
/// # Returns
94-
/// * The matcher for the URL, or the default matcher.
95-
///
9674
/// # Panics
9775
/// * If the registry is poisoned.
9876
pub fn get<S: AsRef<str>>(url: S) -> MatcherFn {

‎postgresql_archive/src/repository/github/models.rs

Copy file name to clipboardExpand all lines: postgresql_archive/src/repository/github/models.rs
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! Structs for GitHub API responses
22
use serde::{Deserialize, Serialize};
33

4+
/// Represents a GitHub release
45
#[derive(Clone, Debug, Deserialize, Serialize)]
56
pub(crate) struct Release {
67
pub url: String,
@@ -15,6 +16,7 @@ pub(crate) struct Release {
1516
pub assets: Vec<Asset>,
1617
}
1718

19+
/// Represents a GitHub asset
1820
#[derive(Clone, Debug, Deserialize, Serialize)]
1921
pub(crate) struct Asset {
2022
pub url: String,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.