Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 4 additions & 2 deletions .github/workflows/code_health.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: dtolnay/rust-toolchain@1.89.0
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: clippy
- run: cargo clippy --tests --no-deps -- --deny clippy::all

Expand All @@ -18,7 +19,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: dtolnay/rust-toolchain@1.89.0
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt
- run: cargo fmt --all --check
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
include:
- build: msrv
os: ubuntu-latest
rust: 1.89.0
rust: 1.91.0
target: x86_64-unknown-linux-gnu
args: "--features=magic-module,rules-profiling"
rust_flags: "-Awarnings"
Expand Down
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ keywords = ["pattern-matching", "cybersecurity", "forensics", "malware", "yara"]

# When updating rust-version also update MSRV in:
# .github/workflows/tests.yaml
# .github/workflows/code_health.yaml
#
rust-version = "1.89.0"
rust-version = "1.91.0"

[workspace]
members = [
Expand Down
7 changes: 7 additions & 0 deletions js-wasm/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#[cfg(any(target_family = "wasm", test))]
use serde::{Deserialize, Serialize};
#[cfg(any(target_family = "wasm", test))]
use yara_x::{
Expand All @@ -14,6 +15,7 @@ use std::time::Duration;
#[cfg(target_family = "wasm")]
use wasm_bindgen::prelude::*;

#[cfg(any(target_family = "wasm", test))]
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
struct ScanResult {
Expand All @@ -23,6 +25,7 @@ struct ScanResult {
matches: Vec<RuleMatch>,
}

#[cfg(any(target_family = "wasm", test))]
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
struct RuleMatch {
Expand All @@ -35,13 +38,15 @@ struct RuleMatch {
patterns: Vec<PatternMatchResult>,
}

#[cfg(any(target_family = "wasm", test))]
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
struct MetadataEntry {
identifier: String,
value: MetadataValue,
}

#[cfg(any(target_family = "wasm", test))]
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(untagged)]
enum MetadataValue {
Expand All @@ -52,6 +57,7 @@ enum MetadataValue {
Bytes(Vec<u8>),
}

#[cfg(any(target_family = "wasm", test))]
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
struct PatternMatchResult {
Expand All @@ -61,6 +67,7 @@ struct PatternMatchResult {
matches: Vec<PatternData>,
}

#[cfg(any(target_family = "wasm", test))]
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
struct PatternData {
Expand Down
Loading