Skip to content

Commit

Permalink
♻️ Manual clippy fixes and optimize imports
Browse files Browse the repository at this point in the history
  • Loading branch information
rster2002 committed May 5, 2024
1 parent e18aed5 commit 67a8ab3
Show file tree
Hide file tree
Showing 125 changed files with 546 additions and 476 deletions.
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions ed-journals/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ chrono = { version = "0.4.38", features = ["serde"] }
serde = { version = "1.0.198", features = ["derive"] }
serde_json = "1.0.116"
kinded = "0.3.0"
lazy_static = "1.4.0"

[features]
default = []
Expand Down
11 changes: 5 additions & 6 deletions ed-journals/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,24 @@
//! and `Status.json` etc will be added in the future. Best place to get started is the [JournalDir]
//! model.

mod macros;
mod models;

pub use models::journal_dir::JournalDir;
pub use models::journal_event::JournalEvent;
pub use models::journal_event_content;
pub use models::journal_event_content::JournalEventContent;
pub use models::journal_event_content::JournalEventContentKind;
pub use models::journal_file::JournalFile;
pub use models::journal_reader::JournalReader;

pub use models::journal_event_content;
mod macros;
mod models;

#[cfg(test)]
mod tests {
use std::env::current_dir;

use crate::models::journal_dir::JournalDir;
use crate::models::journal_event_content::scan_event::ScanEventKind;
use crate::models::journal_event_content::JournalEventContent;
use std::env::current_dir;
use crate::models::journal_event_content::scan_event::ScanEventKind;

#[test]
fn sandbox() {
Expand Down
7 changes: 5 additions & 2 deletions ed-journals/src/models/journal_dir.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use crate::models::journal_file::{JournalFile, JournalFileError};
use std::path::PathBuf;

use thiserror::Error;

use crate::models::journal_file::{JournalFile, JournalFileError};

/// Provides an abstraction on top of the journal directory making it easy to access its contents.
pub struct JournalDir {
dir_path: PathBuf,
Expand Down Expand Up @@ -72,9 +74,10 @@ impl JournalDir {

#[cfg(test)]
mod tests {
use crate::JournalDir;
use std::env::current_dir;

use crate::JournalDir;

#[test]
fn journal_files_oldest_first_are_returned_in_the_correct_order() {
let dir_path = current_dir()
Expand Down
3 changes: 2 additions & 1 deletion ed-journals/src/models/journal_event.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use crate::models::journal_event_content::JournalEventContent;
use chrono::{DateTime, Utc};
use serde::Deserialize;

use crate::models::journal_event_content::JournalEventContent;

/// An entry from a [JournalFile]. Most of the content can be found in the [JournalEventContent].
#[derive(Debug, Deserialize, Clone, PartialEq)]
pub struct JournalEvent {
Expand Down
Loading

0 comments on commit 67a8ab3

Please sign in to comment.