Drop unused, benchmark-only criterion dev-dependency

epel9
Fabio Valentini 2 years ago
parent c7538e8f99
commit 966a49d9c9
No known key found for this signature in database
GPG Key ID: 5AC5F572E5D410AF

@ -0,0 +1,50 @@
diff --git a/src/qc_test.rs b/src/qc_test.rs
index bc76d65..1e02159 100644
--- a/src/qc_test.rs
+++ b/src/qc_test.rs
@@ -16,18 +16,18 @@ const KEY_RUN_LEN: usize = 8;
const KEY_MAX_VAL: u8 = 4;
impl Arbitrary for Key {
- fn arbitrary<G: Gen>(g: &mut G) -> Key {
- let len = g.gen::<usize>() % KEY_RUN_LEN;
+ fn arbitrary(g: &mut Gen) -> Key {
+ let len = usize::arbitrary(g) % KEY_RUN_LEN;
let mut key = Vec::with_capacity(len);
for _ in 0..len {
- key.push(g.gen::<u8>() % KEY_MAX_VAL);
+ key.push(u8::arbitrary(g) % KEY_MAX_VAL);
}
Key(key)
}
}
impl Key {
- fn extend_random<G: Gen>(&self, g: &mut G) -> Key {
+ fn extend_random(&self, g: &mut Gen) -> Key {
self.extend(Key::arbitrary(g))
}
@@ -49,18 +49,18 @@ impl TrieKey for Key {
}
impl Arbitrary for RandomKeys {
- fn arbitrary<G: Gen>(g: &mut G) -> RandomKeys {
- let num_keys = g.gen::<usize>() % MAX_KEYS;
+ fn arbitrary(g: &mut Gen) -> RandomKeys {
+ let num_keys = usize::arbitrary(g) % MAX_KEYS;
let mut keys = Vec::with_capacity(num_keys);
keys.push(Key::arbitrary(g));
for _ in 0..num_keys {
- match g.gen::<u8>() % 10 {
+ match u8::arbitrary(g) % 10 {
// Generate a new random key.
1 => keys.push(Key::arbitrary(g)),
// Extend an existing key.
_ => {
- let i = g.gen::<usize>() % keys.len();
+ let i = usize::arbitrary(g) % keys.len();
let key = keys[i].extend_random(g);
keys.push(key);
}

@ -1,8 +1,11 @@
diff -Naur a/Cargo.toml b/Cargo.toml --- radix_trie-0.2.1/Cargo.toml 2020-10-22T10:41:51+00:00
--- a/Cargo.toml 2020-10-22 03:41:51.000000000 -0700 +++ radix_trie-0.2.1/Cargo.toml 2022-11-04T20:21:08.133287+00:00
+++ b/Cargo.toml 2021-06-25 11:28:55.575860642 -0700 @@ -38,14 +38,12 @@
@@ -42,10 +42,10 @@ [dependencies.serde]
version = "0.3" version = "1.0"
optional = true
-[dev-dependencies.criterion]
-version = "0.3"
[dev-dependencies.quickcheck] [dev-dependencies.quickcheck]
-version = "0.4" -version = "0.4"
@ -14,56 +17,3 @@ diff -Naur a/Cargo.toml b/Cargo.toml
[dev-dependencies.serde_test] [dev-dependencies.serde_test]
version = "1.0" version = "1.0"
diff -Naur a/src/qc_test.rs b/src/qc_test.rs
--- a/src/qc_test.rs 2019-11-16 23:50:28.000000000 -0800
+++ b/src/qc_test.rs 2021-06-25 11:28:40.618805434 -0700
@@ -13,21 +13,21 @@
const MAX_KEYS: usize = 512;
const KEY_RUN_LEN: usize = 8;
-const KEY_MAX_VAL: u8 = 4;
+const KEY_MAX_VAL: usize = 4;
impl Arbitrary for Key {
- fn arbitrary<G: Gen>(g: &mut G) -> Key {
- let len = g.gen::<usize>() % KEY_RUN_LEN;
+ fn arbitrary(g: &mut Gen) -> Key {
+ let len = g.size() % KEY_RUN_LEN;
let mut key = Vec::with_capacity(len);
for _ in 0..len {
- key.push(g.gen::<u8>() % KEY_MAX_VAL);
+ key.push((g.size() % KEY_MAX_VAL) as u8);
}
Key(key)
}
}
impl Key {
- fn extend_random<G: Gen>(&self, g: &mut G) -> Key {
+ fn extend_random(&self, g: &mut Gen) -> Key {
self.extend(Key::arbitrary(g))
}
@@ -49,18 +49,18 @@
}
impl Arbitrary for RandomKeys {
- fn arbitrary<G: Gen>(g: &mut G) -> RandomKeys {
- let num_keys = g.gen::<usize>() % MAX_KEYS;
+ fn arbitrary(g: &mut Gen) -> RandomKeys {
+ let num_keys = g.size() % MAX_KEYS;
let mut keys = Vec::with_capacity(num_keys);
keys.push(Key::arbitrary(g));
for _ in 0..num_keys {
- match g.gen::<u8>() % 10 {
+ match g.size() % 10 {
// Generate a new random key.
1 => keys.push(Key::arbitrary(g)),
// Extend an existing key.
_ => {
- let i = g.gen::<usize>() % keys.len();
+ let i = g.size() % keys.len();
let key = keys[i].extend_random(g);
keys.push(key);
}

@ -1,28 +1,27 @@
# Generated by rust2rpm 17 # Generated by rust2rpm 23
%bcond_without check %bcond_without check
%global debug_package %{nil} %global debug_package %{nil}
%global crate radix_trie %global crate radix_trie
Name: rust-%{crate} Name: rust-radix_trie
Version: 0.2.1 Version: 0.2.1
Release: %autorelease Release: %autorelease
Summary: Generic radix trie data-structure Summary: Generic radix trie data-structure
# Upstream license specification: MIT
License: MIT License: MIT
URL: https://crates.io/crates/radix_trie URL: https://crates.io/crates/radix_trie
Source: %{crates_source} Source: %{crates_source}
# Bump rand to 0.8 and quickcheck to 1.0 # Manually created patch for downstream crate metadata changes
# https://github.com/michaelsproul/rust_radix_trie/pull/65 # * bump quickcheck dev-dependency from 0.4 to 1.0
Patch0: radix_trie-fix-metadata.diff # * bump rand dev-dependency from 0.3 to 0.8
# * drop unused, benchmark-only criterion dev-dependency to speed up builds
Patch: radix_trie-fix-metadata.diff
# * port to quickcheck 1.0:
# https://github.com/michaelsproul/rust_radix_trie/commit/4618661
Patch: 0001-quickcheck-1.0-port.patch
ExclusiveArch: %{rust_arches} BuildRequires: rust-packaging >= 21
%if %{__cargo_skip_build}
BuildArch: noarch
%endif
BuildRequires: rust-packaging
%global _description %{expand: %global _description %{expand:
Generic radix trie data-structure.} Generic radix trie data-structure.}
@ -35,13 +34,14 @@ BuildArch: noarch
%description devel %{_description} %description devel %{_description}
This package contains library source intended for building other packages This package contains library source intended for building other packages which
which use "%{crate}" crate. use the "%{crate}" crate.
%files devel %files devel
%license LICENSE %license %{crate_instdir}/LICENSE
%doc examples README.md CHANGELOG.md %doc %{crate_instdir}/CHANGELOG.md
%{cargo_registry}/%{crate}-%{version_no_tilde}/ %doc %{crate_instdir}/README.md
%{crate_instdir}/
%package -n %{name}+default-devel %package -n %{name}+default-devel
Summary: %{summary} Summary: %{summary}
@ -49,11 +49,11 @@ BuildArch: noarch
%description -n %{name}+default-devel %{_description} %description -n %{name}+default-devel %{_description}
This package contains library source intended for building other packages This package contains library source intended for building other packages which
which use "default" feature of "%{crate}" crate. use the "default" feature of the "%{crate}" crate.
%files -n %{name}+default-devel %files -n %{name}+default-devel
%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml %ghost %{crate_instdir}/Cargo.toml
%package -n %{name}+serde-devel %package -n %{name}+serde-devel
Summary: %{summary} Summary: %{summary}
@ -61,11 +61,11 @@ BuildArch: noarch
%description -n %{name}+serde-devel %{_description} %description -n %{name}+serde-devel %{_description}
This package contains library source intended for building other packages This package contains library source intended for building other packages which
which use "serde" feature of "%{crate}" crate. use the "serde" feature of the "%{crate}" crate.
%files -n %{name}+serde-devel %files -n %{name}+serde-devel
%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml %ghost %{crate_instdir}/Cargo.toml
%prep %prep
%autosetup -n %{crate}-%{version_no_tilde} -p1 %autosetup -n %{crate}-%{version_no_tilde} -p1

Loading…
Cancel
Save