Skip to content

Commit

Permalink
clippy fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Brian L. Troutwine <brian.troutwine@datadoghq.com>
  • Loading branch information
blt committed Oct 24, 2024
1 parent 77358ed commit 32d62c8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lading/src/generator/file_gen/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ pub struct File {
/// happen -- or not.
read_only: bool,

/// The peer of this file, the next in line in rotation. So, if this file is
/// foo.log the peer will be foo.log.1 and its peer foo.log.2 etc.
peer: Option<Inode>,

/// The ordinal number of this File. If the file is foo.log the ordinal
/// number is 0, if foo.log.1 then 1 etc.
ordinal: u8,
Expand Down Expand Up @@ -177,6 +181,7 @@ pub struct State {
now: Tick,
block_cache: block::Cache,
max_bytes_per_file: u64,
max_rotations: u8,
// [GroupID, [Names]]. The interior Vec have size `max_rotations`.
group_names: Vec<Vec<String>>,
next_inode: Inode,
Expand All @@ -193,7 +198,7 @@ impl std::fmt::Debug for State {
.field("max_bytes_per_file", &self.max_bytes_per_file)
.field("group_names", &self.group_names)
.field("next_inode", &self.next_inode)
.finish()
.finish_non_exhaustive()
}
}

Expand Down Expand Up @@ -290,6 +295,8 @@ impl State {
read_only: false,
ordinal: 0,
group_id: 0,

peer: None,
};
nodes.insert(foo_log_inode, Node::File { file: foo_log });

Expand All @@ -304,6 +311,7 @@ impl State {
now: 0,
block_cache,
max_bytes_per_file,
max_rotations,
group_names,
next_inode: 4,
}
Expand Down Expand Up @@ -331,7 +339,6 @@ impl State {

for inode in inodes.drain(..) {
let rotation_data = {
println!("{nodes:?}", nodes = self.nodes);
if let Some(node) = self.nodes.get_mut(&inode) {
match node {
Node::File { file } => {
Expand Down

0 comments on commit 32d62c8

Please sign in to comment.