Skip to content

Commit 8575e24

Browse files
Merge #639
639: Make doc-comments consistently be doc-comments r=curquiza a=CommanderStorm # Pull Request ## Related issue no related issue, as just a docs change ## What does this PR do? - Make doc-comments consistently be doc-comments - Also fixes a few links which `cargo doc` complained about ## PR checklist Please check if your PR fulfills the following requirements: - [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)? - [x] Have you read the contributing guidelines? - [x] Have you made sure that the title is accurate and descriptive of the changes? Thank you so much for contributing to Meilisearch! Co-authored-by: Frank Elsinga <[email protected]>
2 parents 2387973 + c34af95 commit 8575e24

File tree

7 files changed

+30
-30
lines changed

7 files changed

+30
-30
lines changed

src/documents.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use async_trait::async_trait;
22
use serde::{de::DeserializeOwned, Deserialize, Serialize};
33

4-
/// Derive the [`IndexConfig`](crate::documents::IndexConfig) trait.
4+
/// Derive the [`IndexConfig`] trait.
55
///
66
/// ## Field attribute
77
/// Use the `#[index_config(..)]` field attribute to generate the correct settings

src/dumps.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//!
77
//! - Creating a dump is also referred to as exporting it, whereas launching Meilisearch with a dump is referred to as importing it.
88
//!
9-
//! - During a [dump export](Client::create_dump), all [indexes](crate::indexes::Index) of the current instance are exported—together with their documents and settings—and saved as a single `.dump` file.
9+
//! - During a [dump export](crate::client::Client::create_dump), all [indexes](crate::indexes::Index) of the current instance are exported—together with their documents and settings—and saved as a single `.dump` file.
1010
//!
1111
//! - During a dump import, all indexes contained in the indicated `.dump` file are imported along with their associated documents and [settings](crate::settings::Settings).
1212
//! Any existing [index](crate::indexes::Index) with the same uid as an index in the dump file will be overwritten.

src/errors.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,16 @@ pub enum Error {
4949
#[error("HTTP request failed: {}", .0)]
5050
HttpError(#[from] reqwest::Error),
5151

52-
// The library formatting the query parameters encountered an error.
52+
/// The library formatting the query parameters encountered an error.
5353
#[error("Internal Error: could not parse the query parameters: {}", .0)]
5454
Yaup(#[from] yaup::Error),
5555

56-
// The library validating the format of an uuid.
56+
/// The library validating the format of an uuid.
5757
#[cfg(not(target_arch = "wasm32"))]
5858
#[error("The uid of the token has bit an uuid4 format: {}", .0)]
5959
Uuid(#[from] uuid::Error),
6060

61-
// Error thrown in case the version of the Uuid is not v4.
61+
/// Error thrown in case the version of the Uuid is not v4.
6262
#[error("The uid provided to the token is not of version uuidv4")]
6363
InvalidUuid4Version,
6464

src/lib.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@
230230
#![warn(clippy::all)]
231231
#![allow(clippy::needless_doctest_main)]
232232

233-
/// Module containing the [`Client`] struct.
233+
/// Module containing the [`Client`](client::Client) struct.
234234
pub mod client;
235235
/// Module representing the [documents] structures.
236236
pub mod documents;
@@ -242,18 +242,18 @@ pub mod errors;
242242
pub mod features;
243243
/// Module containing the Index struct.
244244
pub mod indexes;
245-
/// Module containing the [`Key`] struct.
245+
/// Module containing the [`Key`](key::Key) struct.
246246
pub mod key;
247247
pub mod request;
248248
/// Module related to search queries and results.
249249
pub mod search;
250-
/// Module containing [`Settings`].
250+
/// Module containing [`Settings`](settings::Settings).
251251
pub mod settings;
252-
/// Module containing the [snapshots] trait.
252+
/// Module containing the [snapshots](snapshots::create_snapshot)-feature.
253253
pub mod snapshots;
254-
/// Module representing the [`TaskInfo`]s.
254+
/// Module representing the [`TaskInfo`](task_info::TaskInfo)s.
255255
pub mod task_info;
256-
/// Module representing the [`Task`]s.
256+
/// Module representing the [`Task`](tasks::Task)s.
257257
pub mod tasks;
258258
/// Module that generates tenant tokens.
259259
#[cfg(not(target_arch = "wasm32"))]

src/search.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ pub struct SearchResults<T> {
7676
pub limit: Option<usize>,
7777
/// Estimated total number of matches.
7878
pub estimated_total_hits: Option<usize>,
79-
// Current page number
79+
/// Current page number
8080
pub page: Option<usize>,
81-
// Maximum number of hits in a page.
81+
/// Maximum number of hits in a page.
8282
pub hits_per_page: Option<usize>,
83-
// Exhaustive number of matches.
83+
/// Exhaustive number of matches.
8484
pub total_hits: Option<usize>,
85-
// Exhaustive number of pages.
85+
/// Exhaustive number of pages.
8686
pub total_pages: Option<usize>,
8787
/// Distribution of the given facets.
8888
pub facet_distribution: Option<HashMap<String, HashMap<String, usize>>>,

src/tasks.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -474,10 +474,10 @@ impl AsRef<u32> for Task {
474474

475475
#[derive(Debug, Serialize, Clone)]
476476
pub struct TasksPaginationFilters {
477-
// Maximum number of tasks to return.
477+
/// Maximum number of tasks to return.
478478
#[serde(skip_serializing_if = "Option::is_none")]
479479
limit: Option<u32>,
480-
// The first task uid that should be returned.
480+
/// The first task uid that should be returned.
481481
#[serde(skip_serializing_if = "Option::is_none")]
482482
from: Option<u32>,
483483
}
@@ -497,52 +497,52 @@ pub type TasksDeleteQuery<'a, Http> = TasksQuery<'a, TasksDeleteFilters, Http>;
497497
pub struct TasksQuery<'a, T, Http: HttpClient> {
498498
#[serde(skip_serializing)]
499499
client: &'a Client<Http>,
500-
// Index uids array to only retrieve the tasks of the indexes.
500+
/// Index uids array to only retrieve the tasks of the indexes.
501501
#[serde(skip_serializing_if = "Option::is_none")]
502502
index_uids: Option<Vec<&'a str>>,
503-
// Statuses array to only retrieve the tasks with these statuses.
503+
/// Statuses array to only retrieve the tasks with these statuses.
504504
#[serde(skip_serializing_if = "Option::is_none")]
505505
statuses: Option<Vec<&'a str>>,
506-
// Types array to only retrieve the tasks with these [TaskType].
506+
/// Types array to only retrieve the tasks with these [`TaskType`]s.
507507
#[serde(skip_serializing_if = "Option::is_none", rename = "types")]
508508
task_types: Option<Vec<&'a str>>,
509-
// Uids of the tasks to retrieve.
509+
/// Uids of the tasks to retrieve.
510510
#[serde(skip_serializing_if = "Option::is_none")]
511511
uids: Option<Vec<&'a u32>>,
512-
// Uids of the tasks that canceled other tasks.
512+
/// Uids of the tasks that canceled other tasks.
513513
#[serde(skip_serializing_if = "Option::is_none")]
514514
canceled_by: Option<Vec<&'a u32>>,
515-
// Date to retrieve all tasks that were enqueued before it.
515+
/// Date to retrieve all tasks that were enqueued before it.
516516
#[serde(
517517
skip_serializing_if = "Option::is_none",
518518
serialize_with = "time::serde::rfc3339::option::serialize"
519519
)]
520520
before_enqueued_at: Option<OffsetDateTime>,
521-
// Date to retrieve all tasks that were enqueued after it.
521+
/// Date to retrieve all tasks that were enqueued after it.
522522
#[serde(
523523
skip_serializing_if = "Option::is_none",
524524
serialize_with = "time::serde::rfc3339::option::serialize"
525525
)]
526526
after_enqueued_at: Option<OffsetDateTime>,
527-
// Date to retrieve all tasks that were started before it.
527+
/// Date to retrieve all tasks that were started before it.
528528
#[serde(
529529
skip_serializing_if = "Option::is_none",
530530
serialize_with = "time::serde::rfc3339::option::serialize"
531531
)]
532532
before_started_at: Option<OffsetDateTime>,
533-
// Date to retrieve all tasks that were started after it.
533+
/// Date to retrieve all tasks that were started after it.
534534
#[serde(
535535
skip_serializing_if = "Option::is_none",
536536
serialize_with = "time::serde::rfc3339::option::serialize"
537537
)]
538538
after_started_at: Option<OffsetDateTime>,
539-
// Date to retrieve all tasks that were finished before it.
539+
/// Date to retrieve all tasks that were finished before it.
540540
#[serde(
541541
skip_serializing_if = "Option::is_none",
542542
serialize_with = "time::serde::rfc3339::option::serialize"
543543
)]
544544
before_finished_at: Option<OffsetDateTime>,
545-
// Date to retrieve all tasks that were finished after it.
545+
/// Date to retrieve all tasks that were finished after it.
546546
#[serde(
547547
skip_serializing_if = "Option::is_none",
548548
serialize_with = "time::serde::rfc3339::option::serialize"
@@ -552,7 +552,7 @@ pub struct TasksQuery<'a, T, Http: HttpClient> {
552552
#[serde(flatten)]
553553
pagination: T,
554554

555-
// Whether to reverse the sort
555+
/// Whether to reverse the sort
556556
#[serde(skip_serializing_if = "Option::is_none")]
557557
reverse: Option<bool>,
558558
}

src/tenant_tokens.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub fn generate_tenant_token(
2929
return Err(Error::InvalidUuid4Version);
3030
}
3131

32-
if expires_at.map_or(false, |expires_at| OffsetDateTime::now_utc() > expires_at) {
32+
if expires_at.is_some_and(|expires_at| OffsetDateTime::now_utc() > expires_at) {
3333
return Err(Error::TenantTokensExpiredSignature);
3434
}
3535

0 commit comments

Comments
 (0)