Skip to content

Commit 2a9e3a9

Browse files
cpoderclaude
andcommitted
style: apply cargo fmt
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5eb0af9 commit 2a9e3a9

2 files changed

Lines changed: 14 additions & 19 deletions

File tree

src/format.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ fn parse_syslog(line: &str) -> Option<Event> {
9595
// Dispatch by the separator at byte 10 so traditional never gets to slice
9696
// 15 bytes off an ISO timestamp and produce garbage hostnames.
9797
let bytes = line.as_bytes();
98-
if bytes.len() > 10 && (bytes[10] == b'T' || bytes[10] == b' ') && bytes.get(4) == Some(&b'-')
99-
{
98+
if bytes.len() > 10 && (bytes[10] == b'T' || bytes[10] == b' ') && bytes.get(4) == Some(&b'-') {
10099
if let Some(ev) = parse_syslog_iso(line) {
101100
return Some(ev);
102101
}
@@ -111,7 +110,8 @@ fn parse_syslog(line: &str) -> Option<Event> {
111110
fn is_month_abbrev(b: &[u8]) -> bool {
112111
matches!(
113112
b,
114-
b"Jan" | b"Feb"
113+
b"Jan"
114+
| b"Feb"
115115
| b"Mar"
116116
| b"Apr"
117117
| b"May"

src/main.rs

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -73,25 +73,20 @@ fn parse_args() -> Result<Args, String> {
7373
}
7474
"-C" | "--context" => {
7575
i += 1;
76-
let n =
77-
parse_num(raw.get(i).ok_or("--context requires a count")?)?;
76+
let n = parse_num(raw.get(i).ok_or("--context requires a count")?)?;
7877
args.context_before = n;
7978
args.context_after = n;
8079
i += 1;
8180
}
8281
"-A" | "--after-context" => {
8382
i += 1;
84-
let n = parse_num(
85-
raw.get(i).ok_or("--after-context requires a count")?,
86-
)?;
83+
let n = parse_num(raw.get(i).ok_or("--after-context requires a count")?)?;
8784
args.context_after = n;
8885
i += 1;
8986
}
9087
"-B" | "--before-context" => {
9188
i += 1;
92-
let n = parse_num(
93-
raw.get(i).ok_or("--before-context requires a count")?,
94-
)?;
89+
let n = parse_num(raw.get(i).ok_or("--before-context requires a count")?)?;
9590
args.context_before = n;
9691
i += 1;
9792
}
@@ -196,14 +191,14 @@ fn main() {
196191
// Helper: process a logical record (text spanning [start..physical_line])
197192
// through the engine and queue resulting matches.
198193
let process_record = |raw: &str,
199-
start_line: u64,
200-
end_line: u64,
201-
detected_format: &mut Option<format::Format>,
202-
eng: &mut engine::Engine,
203-
total_events: &mut u64,
204-
total_matches: &mut u64,
205-
pending: &mut Vec<PendingMatch>,
206-
stdout: &mut io::StdoutLock|
194+
start_line: u64,
195+
end_line: u64,
196+
detected_format: &mut Option<format::Format>,
197+
eng: &mut engine::Engine,
198+
total_events: &mut u64,
199+
total_matches: &mut u64,
200+
pending: &mut Vec<PendingMatch>,
201+
stdout: &mut io::StdoutLock|
207202
-> io::Result<()> {
208203
let trimmed = raw.trim_end();
209204
if trimmed.is_empty() || trimmed.starts_with('#') || trimmed.starts_with("//") {

0 commit comments

Comments
 (0)