Skip to content

Commit d072563

Browse files
committed
chore: update to 2024 edition
1 parent 5981f0f commit d072563

3 files changed

Lines changed: 19 additions & 17 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description = "Rapidly Search and Hunt Through Windows Forensic Artefacts"
66
authors = ["James Dorgan <james@dorgan.io>","Alex Kornitzer <alex.kornitzer@withsecure.com>"]
77
readme = "README.md"
88
license = "GPL3"
9-
edition = "2021"
9+
edition = "2024"
1010

1111

1212
[dependencies]

src/cli.rs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::collections::{hash_map::DefaultHasher, BTreeMap, HashMap, HashSet};
1+
use std::collections::{BTreeMap, HashMap, HashSet, hash_map::DefaultHasher};
22
use std::fs;
33
use std::hash::{Hash, Hasher};
44
use std::io::*;
@@ -7,16 +7,16 @@ use std::time::Duration;
77
use chrono::{DateTime, Local, NaiveDateTime, SecondsFormat, TimeZone, Utc};
88
use chrono_tz::Tz;
99
use indicatif::{ProgressBar, ProgressDrawTarget, ProgressStyle};
10-
use prettytable::{cell, format, Row, Table};
10+
use prettytable::{Row, Table, cell, format};
1111
use rustc_hash::FxHashMap;
1212
use serde::Serialize;
13-
use serde_json::{value::RawValue, Map, Number, Value as Json};
13+
use serde_json::{Map, Number, Value as Json, value::RawValue};
1414
use tau_engine::{Document, Value as Tau};
1515
use uuid::Uuid;
1616

1717
use crate::analyse::shimcache::{TimelineEntity, TimelineTimestamp, TimestampType};
18-
use crate::file::hve::shimcache::EntryType;
1918
use crate::file::Kind as FileKind;
19+
use crate::file::hve::shimcache::EntryType;
2020
use crate::hunt::{Detections, Hunt, Kind};
2121
use crate::rule::{Kind as RuleKind, Level, Rule, Status};
2222
use crate::value::Value;
@@ -236,7 +236,7 @@ fn agg_to_doc<'a>(
236236
Ok(crate::hunt::Document {
237237
kind: first.kind.clone(),
238238
path: first.path,
239-
data: bincode::serde::encode_to_vec(&Value::Object(doc), bincode::config::standard())
239+
data: bincode::serde::encode_to_vec(Value::Object(doc), bincode::config::standard())
240240
.expect("could not serialise collated documents"),
241241
})
242242
}
@@ -607,11 +607,13 @@ pub fn print_detections(
607607
}
608608
cells.push(cell!(table));
609609
} else {
610-
cells.push(cell!(rules
611-
.iter()
612-
.map(|rule| format!("{} {}", RULE_PREFIX, split_tag(rule.name())))
613-
.collect::<Vec<_>>()
614-
.join("\n")));
610+
cells.push(cell!(
611+
rules
612+
.iter()
613+
.map(|rule| format!("{} {}", RULE_PREFIX, split_tag(rule.name())))
614+
.collect::<Vec<_>>()
615+
.join("\n")
616+
));
615617
}
616618
cells.extend(row);
617619
table.add_row(Row::new(cells));

src/hunt.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@ use once_cell::sync::OnceCell;
1313
use rayon::prelude::*;
1414
use rustc_hash::{FxBuildHasher, FxHashMap, FxHasher};
1515
use serde::{
16-
ser::{SerializeStruct, Serializer},
1716
Deserialize, Serialize,
17+
ser::{SerializeStruct, Serializer},
1818
};
19-
use serde_json::{value::RawValue, Value as Json};
19+
use serde_json::{Value as Json, value::RawValue};
2020
use smallvec::SmallVec;
2121
use tau_engine::{
22-
core::parser::{Expression, ModSym, Pattern},
2322
Document as TauDocument, Value as Tau,
23+
core::parser::{Expression, ModSym, Pattern},
2424
};
2525
use uuid::Uuid;
2626

2727
use crate::file::{Document as File, Kind as FileKind, Reader};
2828
use crate::rule::{
29-
chainsaw::{Container, Field, Format},
3029
Aggregate, Filter, Kind as RuleKind, Rule,
30+
chainsaw::{Container, Field, Format},
3131
};
3232
use crate::value::Value;
3333

@@ -1028,7 +1028,7 @@ impl Hunter {
10281028
.expect("could not serialise data");
10291029
let _ = cache.write_all(json.as_bytes());
10301030
let val = *offset;
1031-
let size = json.as_bytes().len();
1031+
let size = json.len();
10321032
*offset += size;
10331033
Some(Ok(Detections {
10341034
hits,
@@ -1080,7 +1080,7 @@ impl Hunter {
10801080
kind: kind.clone(),
10811081
path: file,
10821082
data: bincode::serde::encode_to_vec(
1083-
&value,
1083+
value,
10841084
bincode::config::standard(),
10851085
)?,
10861086
});

0 commit comments

Comments
 (0)