Skip to content

Commit 7d57737

Browse files
committed
remaining Selfs
1 parent e891ae0 commit 7d57737

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed

examples/web_app/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl Component for Model {
4444
type Message = Msg;
4545
type Properties = ();
4646
fn create(_ctx: &Context<Self>) -> Model {
47-
Self {
47+
Model {
4848
// The index method avoids checking the existence of the index.
4949
// It won't make any HTTP request so the function is not async so it's easier to use.
5050
// Use only if you are sure that the index exists.

src/indexes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1441,7 +1441,7 @@ impl<'a> IndexUpdater<'a> {
14411441
/// # index.delete().await.unwrap().wait_for_completion(&client, None, None).await.unwrap();
14421442
/// # });
14431443
/// ```
1444-
pub fn with_primary_key(&mut self, primary_key: impl AsRef<str>) -> &mut Self {
1444+
pub fn with_primary_key(&mut self, primary_key: impl AsRef<str>) -> &mut IndexUpdater<'a> {
14451445
self.primary_key = Some(primary_key.as_ref().to_string());
14461446
self
14471447
}

src/key.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl Key {
5151
/// # client.delete_key(key).await.unwrap();
5252
/// # });
5353
/// ```
54-
pub fn with_description(&mut self, desc: impl AsRef<str>) -> &mut Self {
54+
pub fn with_description(&mut self, desc: impl AsRef<str>) -> &mut Key {
5555
self.description = Some(desc.as_ref().to_string());
5656
self
5757
}
@@ -82,7 +82,7 @@ impl Key {
8282
/// # client.delete_key(key).await.unwrap();
8383
/// # });
8484
/// ```
85-
pub fn with_name(&mut self, desc: impl AsRef<str>) -> &mut Self {
85+
pub fn with_name(&mut self, desc: impl AsRef<str>) -> &mut Key {
8686
self.name = Some(desc.as_ref().to_string());
8787
self
8888
}
@@ -208,7 +208,7 @@ impl KeyUpdater {
208208
/// # client.delete_key(key_update).await.unwrap();
209209
/// # });
210210
/// ```
211-
pub fn with_description(&mut self, desc: impl AsRef<str>) -> &mut Self {
211+
pub fn with_description(&mut self, desc: impl AsRef<str>) -> &mut KeyUpdater {
212212
self.description = Some(desc.as_ref().to_string());
213213
self
214214
}
@@ -241,7 +241,7 @@ impl KeyUpdater {
241241
/// # client.delete_key(key_update).await.unwrap();
242242
/// # });
243243
/// ```
244-
pub fn with_name(&mut self, desc: impl AsRef<str>) -> &mut Self {
244+
pub fn with_name(&mut self, desc: impl AsRef<str>) -> &mut KeyUpdater {
245245
self.name = Some(desc.as_ref().to_string());
246246
self
247247
}
@@ -454,7 +454,7 @@ impl KeyBuilder {
454454
/// let mut builder = KeyBuilder::new();
455455
/// builder.with_actions(vec![Action::Search, Action::DocumentsAdd]);
456456
/// ```
457-
pub fn with_actions(&mut self, actions: impl IntoIterator<Item = Action>) -> &mut Self {
457+
pub fn with_actions(&mut self, actions: impl IntoIterator<Item = Action>) -> &mut KeyBuilder {
458458
self.actions.extend(actions);
459459
self
460460
}
@@ -468,7 +468,7 @@ impl KeyBuilder {
468468
/// let mut builder = KeyBuilder::new();
469469
/// builder.with_action(Action::DocumentsAdd);
470470
/// ```
471-
pub fn with_action(&mut self, action: Action) -> &mut Self {
471+
pub fn with_action(&mut self, action: Action) -> &mut KeyBuilder {
472472
self.actions.push(action);
473473
self
474474
}
@@ -484,7 +484,7 @@ impl KeyBuilder {
484484
/// // create a key that expires in two weeks from now
485485
/// builder.with_expires_at(OffsetDateTime::now_utc() + Duration::WEEK * 2);
486486
/// ```
487-
pub fn with_expires_at(&mut self, expires_at: OffsetDateTime) -> &mut Self {
487+
pub fn with_expires_at(&mut self, expires_at: OffsetDateTime) -> &mut KeyBuilder {
488488
self.expires_at = Some(expires_at);
489489
self
490490
}
@@ -514,7 +514,7 @@ impl KeyBuilder {
514514
pub fn with_indexes(
515515
&mut self,
516516
indexes: impl IntoIterator<Item = impl AsRef<str>>,
517-
) -> &mut Self {
517+
) -> &mut KeyBuilder {
518518
self.indexes = indexes
519519
.into_iter()
520520
.map(|index| index.as_ref().to_string())
@@ -531,7 +531,7 @@ impl KeyBuilder {
531531
/// let mut builder = KeyBuilder::new();
532532
/// builder.with_index("test");
533533
/// ```
534-
pub fn with_index(&mut self, index: impl AsRef<str>) -> &mut Self {
534+
pub fn with_index(&mut self, index: impl AsRef<str>) -> &mut KeyBuilder {
535535
self.indexes.push(index.as_ref().to_string());
536536
self
537537
}
@@ -557,7 +557,7 @@ impl KeyBuilder {
557557
/// # client.delete_key(key).await.unwrap();
558558
/// # });
559559
/// ```
560-
pub fn with_description(&mut self, desc: impl AsRef<str>) -> &mut Self {
560+
pub fn with_description(&mut self, desc: impl AsRef<str>) -> &mut KeyBuilder {
561561
self.description = Some(desc.as_ref().to_string());
562562
self
563563
}
@@ -583,7 +583,7 @@ impl KeyBuilder {
583583
/// # client.delete_key(key).await.unwrap();
584584
/// # });
585585
/// ```
586-
pub fn with_name(&mut self, desc: impl AsRef<str>) -> &mut Self {
586+
pub fn with_name(&mut self, desc: impl AsRef<str>) -> &mut KeyBuilder {
587587
self.name = Some(desc.as_ref().to_string());
588588
self
589589
}
@@ -609,7 +609,7 @@ impl KeyBuilder {
609609
/// # client.delete_key(key).await.unwrap();
610610
/// # });
611611
/// ```
612-
pub fn with_uid(&mut self, desc: impl AsRef<str>) -> &mut Self {
612+
pub fn with_uid(&mut self, desc: impl AsRef<str>) -> &mut KeyBuilder {
613613
self.uid = Some(desc.as_ref().to_string());
614614
self
615615
}

src/settings.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ pub struct Settings {
8383
impl Settings {
8484
/// Create undefined settings.
8585
pub fn new() -> Settings {
86-
Self {
86+
Settings {
8787
synonyms: None,
8888
stop_words: None,
8989
ranking_rules: None,
@@ -103,7 +103,7 @@ impl Settings {
103103
V: AsRef<str>,
104104
U: IntoIterator<Item = V>,
105105
{
106-
Self {
106+
Settings {
107107
synonyms: Some(
108108
synonyms
109109
.into_iter()
@@ -120,7 +120,7 @@ impl Settings {
120120
}
121121

122122
pub fn with_stop_words(self, stop_words: impl IntoIterator<Item = impl AsRef<str>>) -> Settings {
123-
Self {
123+
Settings {
124124
stop_words: Some(
125125
stop_words
126126
.into_iter()
@@ -132,7 +132,7 @@ impl Settings {
132132
}
133133

134134
pub fn with_pagination(self, pagination_settings: PaginationSetting) -> Settings {
135-
Self {
135+
Settings {
136136
pagination: Some(pagination_settings),
137137
..self
138138
}
@@ -142,7 +142,7 @@ impl Settings {
142142
self,
143143
ranking_rules: impl IntoIterator<Item = impl AsRef<str>>,
144144
) -> Settings {
145-
Self {
145+
Settings {
146146
ranking_rules: Some(
147147
ranking_rules
148148
.into_iter()
@@ -157,7 +157,7 @@ impl Settings {
157157
self,
158158
filterable_attributes: impl IntoIterator<Item = impl AsRef<str>>,
159159
) -> Settings {
160-
Self {
160+
Settings {
161161
filterable_attributes: Some(
162162
filterable_attributes
163163
.into_iter()
@@ -172,7 +172,7 @@ impl Settings {
172172
self,
173173
sortable_attributes: impl IntoIterator<Item = impl AsRef<str>>,
174174
) -> Settings {
175-
Self {
175+
Settings {
176176
sortable_attributes: Some(
177177
sortable_attributes
178178
.into_iter()
@@ -184,7 +184,7 @@ impl Settings {
184184
}
185185

186186
pub fn with_distinct_attribute(self, distinct_attribute: impl AsRef<str>) -> Settings {
187-
Self {
187+
Settings {
188188
distinct_attribute: Some(distinct_attribute.as_ref().to_string()),
189189
..self
190190
}
@@ -194,7 +194,7 @@ impl Settings {
194194
self,
195195
searchable_attributes: impl IntoIterator<Item = impl AsRef<str>>,
196196
) -> Settings {
197-
Self {
197+
Settings {
198198
searchable_attributes: Some(
199199
searchable_attributes
200200
.into_iter()
@@ -209,7 +209,7 @@ impl Settings {
209209
self,
210210
displayed_attributes: impl IntoIterator<Item = impl AsRef<str>>,
211211
) -> Settings {
212-
Self {
212+
Settings {
213213
displayed_attributes: Some(
214214
displayed_attributes
215215
.into_iter()
@@ -221,7 +221,7 @@ impl Settings {
221221
}
222222

223223
pub fn with_faceting(self, faceting: &FacetingSettings) -> Settings {
224-
Self {
224+
Settings {
225225
faceting: Some(*faceting),
226226
..self
227227
}

0 commit comments

Comments
 (0)