Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/update to rust 1.8 version 2024 #116

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Should fix clippy
  • Loading branch information
0xCAB0 committed Nov 3, 2024
commit 239a6d9426554ccfe7519583977caba50fbd5d48
9 changes: 0 additions & 9 deletions src/model/filter.rs
Original file line number Diff line number Diff line change
@@ -56,7 +56,6 @@
///let filter: Filter = Filter::builder().search_text(Some(String::from("shoes"))).build();
///```
///

#[builder(default)]
pub search_text: Option<String>,
///
@@ -81,7 +80,6 @@
/// // 4 is catalog_id for Women clothes
/// // 16 is catalog_id for Women Shoes
///```

#[builder(default)]
pub catalog_ids: Option<String>,
///The color IDs to filter items by. Must be formatted as `^[\d+,]*\d+$` regex.
@@ -103,7 +101,6 @@
/// // 1 is color_id for Black
/// // 5 is color_id for Pink
///```

#[builder(default)]
pub color_ids: Option<String>,
/// The brand IDs to filter items by. Must be formatted as `^[\d+,]*\d+$` regex.
@@ -123,7 +120,6 @@
/// // 14 is brand_id for Adidas
/// // 53 is brand_id for Nike
///```

#[builder(default)]
pub brand_ids: Option<String>,
/// The country IDs to filter items by. Must be formatted as `^[\d+,]*\d+$` regex.
@@ -143,7 +139,6 @@
/// // 7 is country_id for Spain
/// // 16 is country_id for France
///```

#[builder(default)]
pub countries_ids: Option<String>,
/// The size IDs to filter items by. Must be formatted as `^[\d+,]*\d+$` regex.
@@ -163,7 +158,6 @@
/// // 1226 is size_id for XXXS / 30 / 2
/// // 102 is size_id for XXS / 32 / 4
///```

#[builder(default)]
pub material_ids: Option<String>,
/// The material IDs to filter items by. Must be formatted as `^[\d+,]*\d+$` regex.
@@ -183,7 +177,6 @@
/// // 44 is material_id for coton
/// // 49 is material_id for silk
///```

#[builder(default)]
pub size_ids: Option<String>,

@@ -196,10 +189,9 @@
///
/// let filter: Filter = Filter::builder().article_status(Some(vec![ArticleStatus::NewTags,ArticleStatus::NewNoTags])).build();
///```

#[builder(default)]
pub article_status: Option<Vec<ArticleStatus>>,
/// The sort order for the retrieved items.

Check failure on line 194 in src/model/filter.rs

GitHub Actions / Test

empty lines after doc comment

Check failure on line 194 in src/model/filter.rs

GitHub Actions / Test

empty lines after doc comment

///### Example
///```rust
@@ -209,7 +201,6 @@
///
/// let filter: Filter = Filter::builder().sort_by(Some(SortBy::PriceAscendant)).build();
///```

#[builder(default)]
pub sort_by: Option<SortBy>,
/// The minimum price of the article
8 changes: 4 additions & 4 deletions src/queries.rs
Original file line number Diff line number Diff line change
@@ -271,7 +271,7 @@ pub struct VintedWrappers<'a> {
pub len: usize,
}

impl<'a> VintedWrappers<'a> {
impl VintedWrappers<'_> {
pub fn new_with_hosts(hosts: Vec<Host>) -> Self {
let len = hosts.len();

@@ -342,7 +342,7 @@ impl<'a> VintedWrappers<'a> {
}
}

impl<'a> Default for VintedWrappers<'a> {
impl Default for VintedWrappers<'_> {
fn default() -> Self {
let hosts = vec![Host::Es, Host::Fr, Host::Lu, Host::Pt, Host::It, Host::Nl];
VintedWrappers::new_with_hosts(hosts)
@@ -361,13 +361,13 @@ pub struct VintedWrapper<'a> {

static WRAPPER_ID: AtomicUsize = AtomicUsize::new(0);

impl<'a> Default for VintedWrapper<'a> {
impl Default for VintedWrapper<'_> {
fn default() -> Self {
Self::new_with_host(Host::Es)
}
}

impl<'a> VintedWrapper<'a> {
impl VintedWrapper<'_> {
/// Creates a new `VintedWrapper` with a random host.
///
/// The `new` function creates a new `VintedWrapper` instance with a random host domain. It initializes the cookie store and client for making requests to the Vinted API.
Loading