Skip to content

Commit 3fca486

Browse files
committed
clippy fixes
Signed-off-by: Brian L. Troutwine <[email protected]>
1 parent aabc315 commit 3fca486

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lading/src/generator/file_gen/model.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ pub struct File {
4949
/// happen -- or not.
5050
read_only: bool,
5151

52+
/// The peer of this file, the next in line in rotation. So, if this file is
53+
/// foo.log the peer will be foo.log.1 and its peer foo.log.2 etc.
54+
peer: Option<Inode>,
55+
5256
/// The ordinal number of this File. If the file is foo.log the ordinal
5357
/// number is 0, if foo.log.1 then 1 etc.
5458
ordinal: u8,
@@ -177,6 +181,7 @@ pub struct State {
177181
now: Tick,
178182
block_cache: block::Cache,
179183
max_bytes_per_file: u64,
184+
max_rotations: u8,
180185
// [GroupID, [Names]]. The interior Vec have size `max_rotations`.
181186
group_names: Vec<Vec<String>>,
182187
next_inode: Inode,
@@ -193,7 +198,7 @@ impl std::fmt::Debug for State {
193198
.field("max_bytes_per_file", &self.max_bytes_per_file)
194199
.field("group_names", &self.group_names)
195200
.field("next_inode", &self.next_inode)
196-
.finish()
201+
.finish_non_exhaustive()
197202
}
198203
}
199204

@@ -290,6 +295,8 @@ impl State {
290295
read_only: false,
291296
ordinal: 0,
292297
group_id: 0,
298+
299+
peer: None,
293300
};
294301
nodes.insert(foo_log_inode, Node::File { file: foo_log });
295302

@@ -304,6 +311,7 @@ impl State {
304311
now: 0,
305312
block_cache,
306313
max_bytes_per_file,
314+
max_rotations,
307315
group_names,
308316
next_inode: 4,
309317
}
@@ -331,7 +339,6 @@ impl State {
331339

332340
for inode in inodes.drain(..) {
333341
let rotation_data = {
334-
println!("{nodes:?}", nodes = self.nodes);
335342
if let Some(node) = self.nodes.get_mut(&inode) {
336343
match node {
337344
Node::File { file } => {

0 commit comments

Comments
 (0)