Skip to content

Commit 1c10308

Browse files
committed
refactor: consolidate proto JSON and YAML serialization into yara-x-proto
Merges the `yara-x-proto-json` and `yara-x-proto-yaml` crates into the main `yara-x-proto` crate. This streamlines the project structure by reducing the number of top-level crates and logically groups all protobuf-related functionalities under a single crate. JSON and YAML serializers are now exposed as `yara_x_proto::json` and `yara_x_proto::yaml` modules.
1 parent 1c6bdc3 commit 1c10308

28 files changed

Lines changed: 38 additions & 549 deletions

File tree

Cargo.lock

Lines changed: 2 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ members = [
2323
"macros",
2424
"parser",
2525
"proto",
26-
"proto-json",
27-
"proto-yaml",
2826
"py",
2927
"ls",
3028
]
@@ -113,8 +111,6 @@ yara-x-fmt = { path = "fmt", version = "1.17.0" }
113111
yara-x-macros = { path = "macros", version = "1.17.0" }
114112
yara-x-parser = { path = "parser", version = "1.17.0" }
115113
yara-x-proto = { path = "proto", version = "1.17.0"}
116-
yara-x-proto-yaml = { path = "proto-yaml", version = "1.17.0" }
117-
yara-x-proto-json = { path = "proto-json", version = "1.17.0" }
118114
zip = { version = "8.2.0", default-features = false }
119115
simd-adler32 = "0.3.9"
120116
simd_cesu8 = "1.1.1"

cli/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ strum_macros = { workspace = true }
6868
yansi = { workspace = true }
6969
yara-x = { workspace = true, features = ["parallel-compilation"] }
7070
yara-x-parser = { workspace = true }
71-
yara-x-proto-yaml = { workspace = true }
72-
yara-x-proto-json = { workspace = true }
71+
yara-x-proto = { workspace = true }
7372
yara-x-fmt = { workspace = true }
7473

7574
chardetng = "1.0.0"

cli/src/commands/dump.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use std::path::PathBuf;
88
use strum_macros::Display;
99

1010
use yara_x::mods::*;
11-
use yara_x_proto_json::Serializer as JsonSerializer;
12-
use yara_x_proto_yaml::Serializer as YamlSerializer;
11+
use yara_x_proto::json::Serializer as JsonSerializer;
12+
use yara_x_proto::yaml::Serializer as YamlSerializer;
1313

1414
use crate::help;
1515

lib/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ goldenfile = { workspace = true }
350350
ihex = { workspace = true }
351351
pretty_assertions = { workspace = true }
352352
rayon = { workspace = true }
353-
yara-x-proto-yaml = { workspace = true }
353+
yara-x-proto = { workspace = true }
354354
zip = { workspace = true }
355355

356356
[[bench]]

lib/src/modules/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ fn test_modules() {
167167
let output_file = mint.new_goldenfile(out_path).unwrap();
168168

169169
// Render the module's output as YAML.
170-
let mut yaml = yara_x_proto_yaml::Serializer::new(output_file);
170+
let mut yaml = yara_x_proto::yaml::Serializer::new(output_file);
171171

172172
yaml.serialize(output).unwrap();
173173
});

proto-json/Cargo.toml

Lines changed: 0 additions & 29 deletions
This file was deleted.

proto-json/build.rs

Lines changed: 0 additions & 13 deletions
This file was deleted.

proto-json/src/yara.proto

Lines changed: 0 additions & 204 deletions
This file was deleted.

0 commit comments

Comments
 (0)