optify 0.12.0__tar.gz → 0.13.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. {optify-0.12.0 → optify-0.13.0}/PKG-INFO +1 -1
  2. {optify-0.12.0 → optify-0.13.0}/pyproject.toml +2 -2
  3. {optify-0.12.0 → optify-0.13.0}/python/optify/Cargo.lock +30 -6
  4. {optify-0.12.0 → optify-0.13.0}/python/optify/Cargo.toml +2 -2
  5. {optify-0.12.0 → optify-0.13.0}/rust/Cargo.toml +4 -0
  6. {optify-0.12.0 → optify-0.13.0}/rust/optify/Cargo.toml +9 -2
  7. {optify-0.12.0 → optify-0.13.0}/rust/optify/README.md +16 -0
  8. {optify-0.12.0 → optify-0.13.0}/rust/optify/benches/caching_benchmark.rs +10 -10
  9. {optify-0.12.0 → optify-0.13.0}/rust/optify/benches/get_all_options_benchmark.rs +6 -6
  10. {optify-0.12.0 → optify-0.13.0}/rust/optify/benches/get_options_benchmark.rs +11 -11
  11. {optify-0.12.0 → optify-0.13.0}/rust/optify/benches/loading_benchmark.rs +4 -4
  12. {optify-0.12.0 → optify-0.13.0}/rust/optify/build.rs +10 -4
  13. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/builder/builder_impl.rs +64 -38
  14. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/builder/builder_options.rs +30 -11
  15. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/builder/extract_configurable_string_files_from_config.rs +2 -3
  16. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/builder/extract_files_from_config.rs +2 -3
  17. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/builder/loading_result.rs +1 -1
  18. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/builder/watcher_builder.rs +2 -1
  19. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/configurable_string/configurable_string_impl.rs +36 -37
  20. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/configurable_values/locator.rs +23 -22
  21. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/json/merge.rs +2 -1
  22. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/json/mod.rs +1 -0
  23. optify-0.13.0/rust/optify/src/json/parse_json_pointer.rs +35 -0
  24. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/lib.rs +3 -0
  25. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/policies/feature_policies.rs +2 -1
  26. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/policies/policy_store.rs +54 -2
  27. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/policies/requester_feature_policy.rs +1 -1
  28. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/policies/requester_policy.rs +3 -1
  29. optify-0.13.0/rust/optify/src/provider/analysis/analysis_data.rs +10 -0
  30. optify-0.13.0/rust/optify/src/provider/analysis/analyze.rs +39 -0
  31. optify-0.13.0/rust/optify/src/provider/analysis/explain.rs +188 -0
  32. optify-0.13.0/rust/optify/src/provider/analysis/mod.rs +17 -0
  33. optify-0.13.0/rust/optify/src/provider/analysis/option_analysis.rs +20 -0
  34. optify-0.13.0/rust/optify/src/provider/analysis/option_origin.rs +17 -0
  35. optify-0.13.0/rust/optify/src/provider/analysis/option_source.rs +26 -0
  36. optify-0.13.0/rust/optify/src/provider/analysis/origin.rs +10 -0
  37. optify-0.13.0/rust/optify/src/provider/analysis/projection.rs +110 -0
  38. optify-0.13.0/rust/optify/src/provider/analysis/provenance.rs +105 -0
  39. optify-0.13.0/rust/optify/src/provider/analysis/replay.rs +137 -0
  40. optify-0.13.0/rust/optify/src/provider/analysis/tracked_merge.rs +211 -0
  41. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/provider/get_options_preferences.rs +3 -0
  42. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/provider/mod.rs +2 -0
  43. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/provider/provider_impl.rs +73 -62
  44. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/provider/provider_trait.rs +27 -3
  45. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/provider/watcher.rs +21 -2
  46. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/provider/watcher_options.rs +3 -2
  47. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/schema/conditions.rs +5 -0
  48. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/schema/metadata.rs +2 -1
  49. {optify-0.12.0 → optify-0.13.0}/LICENSE.txt +0 -0
  50. {optify-0.12.0 → optify-0.13.0}/README.md +0 -0
  51. {optify-0.12.0 → optify-0.13.0}/optify/__init__.py +0 -0
  52. {optify-0.12.0 → optify-0.13.0}/optify/optify.pyi +0 -0
  53. {optify-0.12.0 → optify-0.13.0}/optify/py.typed +0 -0
  54. {optify-0.12.0 → optify-0.13.0}/python/optify/.gitignore +0 -0
  55. {optify-0.12.0 → optify-0.13.0}/python/optify/.vscode/settings.json +0 -0
  56. {optify-0.12.0 → optify-0.13.0}/python/optify/LICENSE.txt +0 -0
  57. {optify-0.12.0 → optify-0.13.0}/python/optify/README.md +0 -0
  58. {optify-0.12.0 → optify-0.13.0}/python/optify/src/lib.rs +0 -0
  59. {optify-0.12.0 → optify-0.13.0}/python/optify/src/preferences.rs +0 -0
  60. {optify-0.12.0 → optify-0.13.0}/python/optify/src/provider.rs +0 -0
  61. {optify-0.12.0 → optify-0.13.0}/python/optify/src/watcher.rs +0 -0
  62. {optify-0.12.0 → optify-0.13.0}/python/optify/tests/test_builder.py +0 -0
  63. {optify-0.12.0 → optify-0.13.0}/python/optify/tests/test_dacite.py +0 -0
  64. {optify-0.12.0 → optify-0.13.0}/python/optify/tests/test_optify.py +0 -0
  65. {optify-0.12.0 → optify-0.13.0}/python/optify/tests/test_provider.py +0 -0
  66. {optify-0.12.0 → optify-0.13.0}/python/optify/tests/test_pydantic.py +0 -0
  67. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/builder/builder_trait.rs +0 -0
  68. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/builder/get_canonical_feature_name.rs +0 -0
  69. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/builder/get_supported_extensions.rs +0 -0
  70. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/builder/mod.rs +0 -0
  71. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/configurable_string/mod.rs +0 -0
  72. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/configurable_values/configurable_list_impl.rs +0 -0
  73. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/configurable_values/mod.rs +0 -0
  74. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/json/escape_json_pointer.rs +0 -0
  75. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/json/reader.rs +0 -0
  76. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/policies/mod.rs +0 -0
  77. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/policies/policies_file_contents.rs +0 -0
  78. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/policies/policy_denied_error.rs +0 -0
  79. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/policies/validate_requester_policies.rs +0 -0
  80. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/provider/constraints.rs +0 -0
  81. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/schema/feature.rs +0 -0
  82. {optify-0.12.0 → optify-0.13.0}/rust/optify/src/schema/mod.rs +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: optify
3
- Version: 0.12.0
3
+ Version: 0.13.0
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -26,11 +26,11 @@ build-backend = "maturin"
26
26
 
27
27
  [package]
28
28
  name = "optify"
29
- version = "0.12.0"
29
+ version = "0.13.0"
30
30
 
31
31
  [tool.poetry]
32
32
  name = "optify"
33
- version = "0.12.0"
33
+ version = "0.13.0"
34
34
  description = "Simplifies getting the right configuration options for a process using pre-loaded configurations from files to manage options for experiments or flights."
35
35
  authors = ["Justin D. Harris"]
36
36
  maintainers = ["Justin D. Harris"]
@@ -119,12 +119,13 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
119
119
 
120
120
  [[package]]
121
121
  name = "config"
122
- version = "0.15.23"
122
+ version = "0.15.25"
123
123
  source = "registry+https://github.com/rust-lang/crates.io-index"
124
- checksum = "f316c6237b2d38be61949ecd15268a4c6ca32570079394a2444d9ce2c72a72d8"
124
+ checksum = "b85f248a4de22d204ceabc6299d89d2c70fbd7f09fea53c06c852369652d8139"
125
125
  dependencies = [
126
126
  "async-trait",
127
127
  "convert_case",
128
+ "indexmap",
128
129
  "json5",
129
130
  "pathdiff",
130
131
  "ron",
@@ -558,6 +559,18 @@ dependencies = [
558
559
  "icu_properties",
559
560
  ]
560
561
 
562
+ [[package]]
563
+ name = "indexmap"
564
+ version = "2.14.0"
565
+ source = "registry+https://github.com/rust-lang/crates.io-index"
566
+ checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9"
567
+ dependencies = [
568
+ "equivalent",
569
+ "hashbrown 0.17.1",
570
+ "serde",
571
+ "serde_core",
572
+ ]
573
+
561
574
  [[package]]
562
575
  name = "inotify"
563
576
  version = "0.11.1"
@@ -689,9 +702,9 @@ dependencies = [
689
702
 
690
703
  [[package]]
691
704
  name = "kstring"
692
- version = "2.0.2"
705
+ version = "2.0.5"
693
706
  source = "registry+https://github.com/rust-lang/crates.io-index"
694
- checksum = "558bf9508a558512042d3095138b1f7b8fe90c5467d94f9f1da28b3731c5dbd1"
707
+ checksum = "7a09b82a7f771ed02dc0dd9b27130a0fa5499fa15ed3027116c1e5e4e591bd9e"
695
708
  dependencies = [
696
709
  "serde",
697
710
  "static_assertions",
@@ -941,12 +954,13 @@ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
941
954
 
942
955
  [[package]]
943
956
  name = "optify"
944
- version = "1.5.0"
957
+ version = "1.6.0"
945
958
  dependencies = [
946
959
  "config",
947
960
  "cow-utils",
948
961
  "dunce",
949
962
  "jsonschema",
963
+ "kstring",
950
964
  "liquid",
951
965
  "notify",
952
966
  "notify-debouncer-full",
@@ -961,7 +975,7 @@ dependencies = [
961
975
 
962
976
  [[package]]
963
977
  name = "optify-python"
964
- version = "0.12.0"
978
+ version = "0.13.0"
965
979
  dependencies = [
966
980
  "optify",
967
981
  "pyo3",
@@ -1265,6 +1279,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
1265
1279
  checksum = "4147b952f3f819eca0e99527022f7d6a8d05f111aeb0a62960c74eb283bec8fc"
1266
1280
  dependencies = [
1267
1281
  "bitflags",
1282
+ "indexmap",
1268
1283
  "once_cell",
1269
1284
  "serde",
1270
1285
  "serde_derive",
@@ -1351,6 +1366,7 @@ version = "1.0.149"
1351
1366
  source = "registry+https://github.com/rust-lang/crates.io-index"
1352
1367
  checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86"
1353
1368
  dependencies = [
1369
+ "indexmap",
1354
1370
  "itoa",
1355
1371
  "memchr",
1356
1372
  "serde",
@@ -1501,10 +1517,12 @@ version = "1.1.2+spec-1.1.0"
1501
1517
  source = "registry+https://github.com/rust-lang/crates.io-index"
1502
1518
  checksum = "81f3d15e84cbcd896376e6730314d59fb5a87f31e4b038454184435cd57defee"
1503
1519
  dependencies = [
1520
+ "indexmap",
1504
1521
  "serde_core",
1505
1522
  "serde_spanned",
1506
1523
  "toml_datetime",
1507
1524
  "toml_parser",
1525
+ "toml_writer",
1508
1526
  "winnow",
1509
1527
  ]
1510
1528
 
@@ -1526,6 +1544,12 @@ dependencies = [
1526
1544
  "winnow",
1527
1545
  ]
1528
1546
 
1547
+ [[package]]
1548
+ name = "toml_writer"
1549
+ version = "1.1.2+spec-1.1.0"
1550
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1551
+ checksum = "7d56353a2a665ad0f41a421187180aab746c8c325620617ad883a99a1cbe66d2"
1552
+
1529
1553
  [[package]]
1530
1554
  name = "typeid"
1531
1555
  version = "1.0.3"
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "optify-python"
3
- version = "0.12.0"
3
+ version = "0.13.0"
4
4
  edition = "2021"
5
5
 
6
6
  description = "Simplifies getting the right configuration options for a process using pre-loaded configurations from files (JSON, YAML, etc.) to manage options for experiments or flights. This library is mainly made to support building implementations for other languages such as Node.js, Python, and Ruby. It is not meant to be consumed directly yet."
@@ -15,5 +15,5 @@ name = "optify"
15
15
  crate-type = ["cdylib"]
16
16
 
17
17
  [dependencies]
18
- optify = { path = "../../rust/optify", version = "1.5.0" }
18
+ optify = { path = "../../rust/optify", version = "1.6.0" }
19
19
  pyo3 = "0.29.0"
@@ -4,3 +4,7 @@ members = [
4
4
  "optify-cli",
5
5
  ]
6
6
  resolver = "2"
7
+
8
+ [workspace.lints.clippy]
9
+ pedantic = "warn"
10
+ perf = "warn"
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "optify"
3
- version = "1.5.0"
3
+ version = "1.6.0"
4
4
  edition = "2021"
5
5
  build = "build.rs"
6
6
 
@@ -17,14 +17,18 @@ exclude = [
17
17
  "tests/*",
18
18
  ]
19
19
 
20
+ [lints]
21
+ workspace = true
22
+
20
23
  [dependencies]
21
- config = "0.15.23"
24
+ config = { version = "0.15.25", features = ["preserve_order"] }
22
25
  cow-utils = "0.1.3"
23
26
  dunce = "1.0.5"
24
27
  # HTTP/file schema resolution (`resolve-http`) requires a TLS backend.
25
28
  # `tls-ring` fails to cross-compile for aarch64; the default `tls-aws-lc-rs` needs cmake/lld unavailable in CI Docker containers.
26
29
  # The embedded Optify schema is registered explicitly, while local file resolution supports relative references from custom schemas.
27
30
  jsonschema = { version = "0.48.0", default-features = false, features = ["resolve-file"] }
31
+ kstring = "2.0.5"
28
32
  liquid = "0.26.11"
29
33
  notify = "8.2.0"
30
34
  # For fetching JSON schema files from the web, but it requires OpenSSL, which is tricky to install in CI environments in Docker containers.
@@ -44,6 +48,9 @@ regex = "1.12.3"
44
48
  criterion = "0.5.1"
45
49
  tempfile = "3"
46
50
 
51
+ [target.'cfg(unix)'.dev-dependencies]
52
+ libc = "0.2"
53
+
47
54
  [[bench]]
48
55
  name = "caching_benchmark"
49
56
  harness = false
@@ -56,6 +56,22 @@ Use `get_all_options` when you want the full merged options object instead of on
56
56
  let options = provider.get_all_options(&["feature_A", "feature_B/initial"], None, None)?;
57
57
  ```
58
58
 
59
+ Use `analyze` to explain which feature and chain of imports set a value.
60
+ Analysis must be enabled with `BuilderOptions.is_analysis_enabled` because it retains more data.
61
+ See [Analysis](../../docs/Analysis.md) for details.
62
+
63
+ ```rust
64
+ use optify::builder::BuilderOptions;
65
+
66
+ let options = BuilderOptions {
67
+ is_analysis_enabled: true,
68
+ ..Default::default()
69
+ };
70
+ let provider = OptionsProvider::build_with_options("path/to/configs", options)?;
71
+ let analysis = provider.analyze("/myConfig/myArray", &["feature_A", "feature_B/initial"], None)?;
72
+ println!("{:?}", analysis.origins[0].source.defining_feature());
73
+ ```
74
+
59
75
  See [tests] for examples and tests for different implementations of this format for managing options.
60
76
 
61
77
  ## How It Works
@@ -18,7 +18,7 @@ fn benchmark_cache_vs_no_cache(c: &mut Criterion) {
18
18
  let _ = provider
19
19
  .get_all_options(black_box(&features_a), None, None)
20
20
  .unwrap();
21
- })
21
+ });
22
22
  });
23
23
 
24
24
  // Benchmark with caching (should be faster after first call)
@@ -32,7 +32,7 @@ fn benchmark_cache_vs_no_cache(c: &mut Criterion) {
32
32
  let _ = provider
33
33
  .get_all_options(black_box(&features_a), Some(&cache_options), None)
34
34
  .unwrap();
35
- })
35
+ });
36
36
  });
37
37
 
38
38
  // Benchmark specific config retrieval without cache
@@ -46,7 +46,7 @@ fn benchmark_cache_vs_no_cache(c: &mut Criterion) {
46
46
  None,
47
47
  )
48
48
  .unwrap();
49
- })
49
+ });
50
50
  });
51
51
 
52
52
  // Benchmark specific config retrieval with cache
@@ -65,7 +65,7 @@ fn benchmark_cache_vs_no_cache(c: &mut Criterion) {
65
65
  None,
66
66
  )
67
67
  .unwrap();
68
- })
68
+ });
69
69
  });
70
70
 
71
71
  group.finish();
@@ -87,7 +87,7 @@ fn benchmark_cache_with_preferences(c: &mut Criterion) {
87
87
  let _ = provider
88
88
  .get_all_options(black_box(&features_a), None, Some(&preferences))
89
89
  .unwrap();
90
- })
90
+ });
91
91
  });
92
92
 
93
93
  // Benchmark with caching and preferences (cache hit)
@@ -108,7 +108,7 @@ fn benchmark_cache_with_preferences(c: &mut Criterion) {
108
108
  Some(&preferences),
109
109
  )
110
110
  .unwrap();
111
- })
111
+ });
112
112
  });
113
113
 
114
114
  group.finish();
@@ -127,7 +127,7 @@ fn benchmark_cache_multiple_features(c: &mut Criterion) {
127
127
  let _ = provider
128
128
  .get_all_options(black_box(&features_a_b), None, None)
129
129
  .unwrap();
130
- })
130
+ });
131
131
  });
132
132
 
133
133
  // Benchmark with caching for multiple features (cache hit)
@@ -141,7 +141,7 @@ fn benchmark_cache_multiple_features(c: &mut Criterion) {
141
141
  let _ = provider
142
142
  .get_all_options(black_box(&features_a_b), Some(&cache_options), None)
143
143
  .unwrap();
144
- })
144
+ });
145
145
  });
146
146
 
147
147
  group.finish();
@@ -162,7 +162,7 @@ fn benchmark_cache_performance_scaling(c: &mut Criterion) {
162
162
  .get_all_options(black_box(&features_a), None, None)
163
163
  .unwrap();
164
164
  }
165
- })
165
+ });
166
166
  });
167
167
 
168
168
  // Benchmark repeated calls with caching (should show significant improvement)
@@ -178,7 +178,7 @@ fn benchmark_cache_performance_scaling(c: &mut Criterion) {
178
178
  .get_all_options(black_box(&features_a), Some(&cache_options), None)
179
179
  .unwrap();
180
180
  }
181
- })
181
+ });
182
182
  });
183
183
 
184
184
  group.finish();
@@ -45,7 +45,7 @@ fn benchmark_get_all_options_breakdown(c: &mut Criterion) {
45
45
  provider
46
46
  .get_all_options(black_box(features), None, None)
47
47
  .unwrap()
48
- })
48
+ });
49
49
  },
50
50
  );
51
51
  }
@@ -74,7 +74,7 @@ fn benchmark_configurable_strings(c: &mut Criterion) {
74
74
  provider
75
75
  .get_all_options(black_box(&features_with_files), None, None)
76
76
  .unwrap()
77
- })
77
+ });
78
78
  });
79
79
 
80
80
  // With configurable strings enabled
@@ -86,7 +86,7 @@ fn benchmark_configurable_strings(c: &mut Criterion) {
86
86
  provider
87
87
  .get_all_options(black_box(&features_with_files), None, Some(&preferences))
88
88
  .unwrap()
89
- })
89
+ });
90
90
  });
91
91
 
92
92
  group.finish();
@@ -105,7 +105,7 @@ fn benchmark_with_overrides(c: &mut Criterion) {
105
105
  provider
106
106
  .get_all_options(black_box(&features), None, None)
107
107
  .unwrap()
108
- })
108
+ });
109
109
  });
110
110
 
111
111
  // With small override
@@ -117,7 +117,7 @@ fn benchmark_with_overrides(c: &mut Criterion) {
117
117
  provider
118
118
  .get_all_options(black_box(&features), None, Some(&preferences))
119
119
  .unwrap()
120
- })
120
+ });
121
121
  });
122
122
 
123
123
  // With larger override
@@ -139,7 +139,7 @@ fn benchmark_with_overrides(c: &mut Criterion) {
139
139
  provider
140
140
  .get_all_options(black_box(&features), None, Some(&preferences))
141
141
  .unwrap()
142
- })
142
+ });
143
143
  });
144
144
 
145
145
  group.finish();
@@ -50,7 +50,7 @@ fn benchmark_get_options_with_preferences_breakdown(c: &mut Criterion) {
50
50
  provider
51
51
  .get_options(black_box(*key), black_box(*features))
52
52
  .unwrap()
53
- })
53
+ });
54
54
  },
55
55
  );
56
56
 
@@ -69,7 +69,7 @@ fn benchmark_get_options_with_preferences_breakdown(c: &mut Criterion) {
69
69
  Some(&preferences),
70
70
  )
71
71
  .unwrap()
72
- })
72
+ });
73
73
  },
74
74
  );
75
75
 
@@ -93,7 +93,7 @@ fn benchmark_get_options_with_preferences_breakdown(c: &mut Criterion) {
93
93
  None,
94
94
  )
95
95
  .unwrap()
96
- })
96
+ });
97
97
  },
98
98
  );
99
99
 
@@ -106,7 +106,7 @@ fn benchmark_get_options_with_preferences_breakdown(c: &mut Criterion) {
106
106
  provider
107
107
  .get_filtered_feature_names(black_box(features), None)
108
108
  .unwrap()
109
- })
109
+ });
110
110
  },
111
111
  );
112
112
 
@@ -119,7 +119,7 @@ fn benchmark_get_options_with_preferences_breakdown(c: &mut Criterion) {
119
119
  provider
120
120
  .get_canonical_feature_names(black_box(features))
121
121
  .unwrap()
122
- })
122
+ });
123
123
  },
124
124
  );
125
125
  }
@@ -145,7 +145,7 @@ fn benchmark_with_overrides(c: &mut Criterion) {
145
145
  None,
146
146
  )
147
147
  .unwrap()
148
- })
148
+ });
149
149
  });
150
150
 
151
151
  // With small override
@@ -162,7 +162,7 @@ fn benchmark_with_overrides(c: &mut Criterion) {
162
162
  Some(&preferences),
163
163
  )
164
164
  .unwrap()
165
- })
165
+ });
166
166
  });
167
167
 
168
168
  // With larger override
@@ -189,7 +189,7 @@ fn benchmark_with_overrides(c: &mut Criterion) {
189
189
  Some(&preferences),
190
190
  )
191
191
  .unwrap()
192
- })
192
+ });
193
193
  });
194
194
 
195
195
  group.finish();
@@ -214,7 +214,7 @@ fn benchmark_skip_feature_name_conversion(c: &mut Criterion) {
214
214
  Some(&preferences),
215
215
  )
216
216
  .unwrap()
217
- })
217
+ });
218
218
  });
219
219
 
220
220
  // Without feature name conversion
@@ -231,7 +231,7 @@ fn benchmark_skip_feature_name_conversion(c: &mut Criterion) {
231
231
  Some(&preferences),
232
232
  )
233
233
  .unwrap()
234
- })
234
+ });
235
235
  });
236
236
 
237
237
  group.finish();
@@ -277,7 +277,7 @@ fn benchmark_many_features(c: &mut Criterion) {
277
277
  black_box(preferences),
278
278
  )
279
279
  .unwrap()
280
- })
280
+ });
281
281
  });
282
282
  }
283
283
 
@@ -68,7 +68,7 @@ fn create_test_files(dir: &Path, num_files: usize) {
68
68
  i - 1
69
69
  )
70
70
  } else {
71
- "".to_string()
71
+ String::new()
72
72
  };
73
73
 
74
74
  let content = format!(
@@ -99,8 +99,8 @@ options:
99
99
  let mut file = fs::File::create(&file_path).unwrap();
100
100
 
101
101
  let content = format!(
102
- r#"This is what goes in the file {i}
103
- "#
102
+ r"This is what goes in the file {i}
103
+ "
104
104
  );
105
105
  file.write_all(content.as_bytes()).unwrap();
106
106
  }
@@ -134,7 +134,7 @@ fn benchmark_loading(c: &mut Criterion) {
134
134
  .unwrap(),
135
135
  );
136
136
  builder.add_directory(black_box(test_dir)).unwrap();
137
- })
137
+ });
138
138
  });
139
139
 
140
140
  group.finish();
@@ -35,19 +35,25 @@ fn copy_schema_file() -> Result<(), Box<dyn std::error::Error>> {
35
35
  }
36
36
 
37
37
  if let Some(path) = source_path {
38
- fs::copy(path, &dest_path)
39
- .unwrap_or_else(|e| panic!("Failed to copy schema file from {path:?}: {e}"));
38
+ fs::copy(path, &dest_path).unwrap_or_else(|e| {
39
+ panic!(
40
+ "Failed to copy schema file from \"{}\": {e}",
41
+ path.display()
42
+ )
43
+ });
40
44
  println!("cargo:rerun-if-changed={}", path.display());
41
45
  } else {
42
46
  panic!(
43
- "Schema file not found at any of the expected locations: {possible_paths:?}. If you are running `cargo publish`, then the schema needs to be copied from {original_path:?} to {copied_path:?}.",
47
+ "Schema file not found at any of the expected locations: {possible_paths:?}. If you are running `cargo publish`, then the schema needs to be copied from \"{}\" to \"{}\".",
48
+ original_path.display(),
49
+ copied_path.display(),
44
50
  );
45
51
  }
46
52
 
47
53
  Ok(())
48
54
  }
49
55
 
50
- /// Dynamically generate the tests for each folder in tests/test_suites.
56
+ /// Dynamically generate the tests for each folder in `tests/test_suites`.
51
57
  fn generate_test_suites() {
52
58
  let test_suites_path = Path::new("../../tests/test_suites");
53
59
  if !test_suites_path.exists() {