Skip to content

Commit

Permalink
♻️ Run cargo clippy --fix and fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
rster2002 committed May 8, 2024
1 parent 3247c45 commit 0db7921
Show file tree
Hide file tree
Showing 77 changed files with 1,935 additions and 1,763 deletions.
19 changes: 7 additions & 12 deletions ed-journals/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,29 +39,24 @@ mod tests {
.unwrap()
.join("test-journals");

let log_dir = JournalDir::new(dir_path)
.unwrap();
let log_dir = JournalDir::new(dir_path).unwrap();

let logs = log_dir.journal_logs()
.unwrap();
let logs = log_dir.journal_logs().unwrap();

assert!(logs.len() > 10);

let mut file_header_count = 0;
let mut entry_count = 0;

for journal in &logs {
let reader = journal.create_reader()
.unwrap();
let reader = journal.create_reader().unwrap();

for entry in reader {
entry_count += 1;
match entry.unwrap().content {
JournalEventContent::FileHeader(_) => {
file_header_count += 1;
},
_ => {},
};

if let JournalEventContent::FileHeader(_) = entry.unwrap().content {
file_header_count += 1;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion ed-journals/src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ pub mod journal_event;
pub mod journal_event_content;
pub mod journal_file;
pub mod journal_file_reader;
pub mod live_journal_file_reader;
pub mod live_journal_dir_reader;
pub mod live_journal_file_reader;
166 changes: 83 additions & 83 deletions ed-journals/src/models/journal_event_content.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use kinded::Kinded;
use serde::Deserialize;
use crate::journal_event_content::book_dropship_event::BookDropshipEvent;
use crate::journal_event_content::buy_trade_data_event::BuyTradeDateEvent;
use crate::journal_event_content::cancel_dropship_event::CancelDropshipEvent;
Expand Down Expand Up @@ -67,6 +65,8 @@ use crate::journal_event_content::transfer_micro_resources_event::TransferMicroR
use crate::journal_event_content::upgrade_suit_event::UpgradeSuitEvent;
use crate::journal_event_content::upgrade_weapon_event::UpgradeWeaponEvent;
use crate::journal_event_content::won_a_trophy_for_squadron_event::WonATrophyForSquadronEvent;
use kinded::Kinded;
use serde::Deserialize;

use crate::models::journal_event_content::afmu_repairs_event::AFMURepairsEvent;
use crate::models::journal_event_content::applied_to_squadron_event::AppliedToSquadronEvent;
Expand Down Expand Up @@ -252,34 +252,66 @@ pub mod approach_settlement_event;
pub mod asteroid_cracked_event;
pub mod backpack_change_event;
pub mod backpack_event;
mod book_dropship_event;
pub mod book_taxi_event;
pub mod bounty_event;
pub mod buy_ammo_event;
pub mod buy_drones_event;
pub mod buy_exploration_data_event;
pub mod buy_micro_resource_event;
pub mod buy_suit_event;
mod buy_trade_data_event;
pub mod buy_weapon_event;
mod cancel_dropship_event;
mod cancel_taxi_event;
mod cap_ship_bond_event;
pub mod cargo_depot_event;
pub mod cargo_event;
pub mod cargo_transfer_event;
pub mod carrier_bank_transfer_event;
pub mod carrier_buy_event;
mod carrier_cancel_decommission_event;
pub mod carrier_crew_services_event;
mod carrier_decommision_event;
pub mod carrier_deposit_fuel_event;
mod carrier_docking_permission_event;
pub mod carrier_finance_event;
pub mod carrier_jump_cancelled_event;
pub mod carrier_jump_event;
pub mod carrier_jump_request_event;
mod carrier_module_pack_event;
mod carrier_name_changed_event;
mod carrier_ship_pack_event;
pub mod carrier_stats_event;
mod carrier_trade_order_event;
mod change_crew_role_event;
mod clear_impound_event;
pub mod clear_saved_game_event;
pub mod codex_entry_event;
pub mod collect_cargo_event;
pub mod collect_items_event;
pub mod commander_event;
pub mod commit_crime_event;
mod community_goal_discard_event;
mod community_goal_event;
mod community_goal_join_event;
mod community_goal_reward_event;
mod continued_event;
pub mod create_suit_loadout_event;
pub mod crew_assign_event;
mod crew_fire_event;
pub mod crew_hire_event;
mod crew_launch_fighter_event;
mod crew_member_joins_event;
mod crew_member_quits_event;
mod crew_member_role_change_event;
pub mod crime_victim_event;
pub mod data_scanned_event;
pub mod datalink_scan_event;
mod datalink_voucher_event;
mod delete_suit_loadout_event;
pub mod died_event;
mod disbanded_squadron_event;
pub mod discovery_scan_event;
pub mod disembark_event;
pub mod dock_fighter_event;
Expand All @@ -291,16 +323,22 @@ pub mod docking_granted_event;
pub mod docking_requested_event;
pub mod docking_timeout_event;
pub mod drop_items_event;
mod drop_ship_deploy_event;
pub mod eject_cargo_event;
pub mod embark_event;
mod end_crew_session_event;
mod engineer_apply_event;
pub mod engineer_contribution_event;
pub mod engineer_craft_event;
pub mod engineer_progress_event;
pub mod escape_interdiction_event;
pub mod faction_kill_bond_event;
pub mod fetch_remote_module_event;
pub mod fighter_destroyed_event;
pub mod fighter_rebuilt_event;
pub mod file_header_event;
pub mod friends_event;
pub mod fs_embark_event;
pub mod fsd_jump_event;
pub mod fsd_target_event;
pub mod fss_all_bodies_found_event;
Expand All @@ -310,20 +348,31 @@ pub mod fss_signal_discovered_event;
pub mod fuel_scoop_event;
pub mod hull_damage_event;
pub mod interdicted_event;
pub mod interdiction_event;
mod invited_to_squadron_event;
pub mod jet_cone_boost_event;
mod jet_cone_damage_event;
mod join_a_crew_event;
mod joined_squadron_event;
mod kick_crew_member_event;
mod kicked_from_squadron_event;
pub mod launch_drone_event;
pub mod launch_fighter_event;
pub mod launch_srv_event;
pub mod leave_body_event;
mod left_squadron_event;
pub mod liftoff_event;
pub mod load_game_event;
pub mod loadout_equip_module_event;
pub mod loadout_event;
mod loadout_remove_module_event;
pub mod location_event;
pub mod market_buy_event;
pub mod market_event;
pub mod market_sell_event;
mod mass_module_store_event;
pub mod material_collected_event;
mod material_discarded_event;
pub mod material_discovered_event;
pub mod material_trade_event;
pub mod materials_event;
Expand All @@ -334,9 +383,11 @@ pub mod mission_completed_event;
pub mod mission_failed_event;
pub mod mission_redirected_event;
pub mod missions_event;
pub mod module_buy_and_store_event;
pub mod module_buy_event;
pub mod module_retrieve_event;
pub mod module_sell_event;
pub mod module_sell_remote_event;
pub mod module_store_event;
pub mod module_swap_event;
pub mod multi_sell_exploration_data_event;
Expand All @@ -349,14 +400,27 @@ pub mod outfitting_event;
pub mod passengers_event;
pub mod pay_bounties_event;
pub mod pay_fines_event;
mod powerplay_collect_event;
mod powerplay_defect_event;
mod powerplay_deliver_event;
pub mod powerplay_event;
mod powerplay_fast_track_event;
mod powerplay_join_event;
pub mod powerplay_leave_event;
pub mod powerplay_salary_event;
mod powerplay_vote_event;
pub mod progress_event;
pub mod promotion_event;
pub mod prospected_asteroid_event;
mod pvp_kill_event;
mod quit_a_crew_event;
pub mod rank_event;
mod reboot_repair_event;
pub mod receive_text_event;
pub mod redeem_voucher_event;
pub mod refuel_all_event;
mod refuel_partial_event;
mod rename_suit_loadout_event;
pub mod repair_all_event;
pub mod repair_drone_event;
pub mod repair_event;
Expand All @@ -370,35 +434,34 @@ pub mod scan_bary_centre_event;
pub mod scan_event;
pub mod scan_organic_event;
pub mod scanned_event;
mod scientific_research_event;
mod screenshot_event;
pub mod search_and_rescue_event;
pub mod sell_drones_event;
mod sell_exploration_date_event;
mod sell_micro_resources_event;
pub mod sell_organic_data;
mod sell_ship_on_rebuy_event;
mod sell_suit_event;
mod sell_weapon_event;
pub mod send_text_event;
pub mod set_user_ship_name_event;
pub mod book_taxi_event;
pub mod carrier_buy_event;
pub mod carrier_crew_services_event;
pub mod carrier_finance_event;
pub mod crew_hire_event;
pub mod engineer_contribution_event;
pub mod faction_kill_bond_event;
pub mod fs_embark_event;
pub mod interdiction_event;
pub mod module_buy_and_store_event;
pub mod module_sell_remote_event;
pub mod powerplay_leave_event;
pub mod powerplay_salary_event;
pub mod search_and_rescue_event;
/// Contains structs and enums which are shared across events. Things like commodity and material
/// names, ship types, exobiology data etc. can be found here.
pub mod shared;
mod shared_bookmark_to_squadron_event;
pub mod shield_state_event;
pub mod ship_locker_event;
pub mod ship_targeted_event;
pub mod shipyard_buy_event;
pub mod shipyard_event;
pub mod shipyard_new_event;
mod shipyard_sell_event;
pub mod shipyard_swap_event;
pub mod shipyard_transfer_event;
mod squadron_created_event;
mod squadron_demotion_event;
mod squadron_promotion_event;
pub mod squadron_startup_event;
pub mod srv_destroyed_event;
pub mod start_jump_event;
Expand All @@ -413,82 +476,19 @@ pub mod switch_suit_loadout_event;
pub mod synthasis_event;
pub mod technology_broker_event;
pub mod touchdown_event;
mod trade_micro_resources_event;
mod transfer_micro_resources_event;
pub mod under_attack_event;
pub mod undocked_event;
mod upgrade_suit_event;
mod upgrade_weapon_event;
pub mod use_consumable_event;
pub mod uss_drop_event;
pub mod vehicle_switch_event;
pub mod wing_add_event;
pub mod wing_invite_event;
pub mod wing_join_event;
mod cap_ship_bond_event;
mod pvp_kill_event;
mod material_discarded_event;
mod sell_exploration_date_event;
mod screenshot_event;
mod buy_trade_data_event;
mod community_goal_event;
mod community_goal_discard_event;
mod community_goal_join_event;
mod community_goal_reward_event;
mod crew_fire_event;
mod engineer_apply_event;
mod mass_module_store_event;
mod refuel_partial_event;
mod scientific_research_event;
mod sell_ship_on_rebuy_event;
mod shipyard_sell_event;
mod clear_impound_event;
mod powerplay_collect_event;
mod powerplay_defect_event;
mod powerplay_deliver_event;
mod powerplay_fast_track_event;
mod powerplay_join_event;
mod powerplay_vote_event;
mod disbanded_squadron_event;
mod invited_to_squadron_event;
mod joined_squadron_event;
mod kicked_from_squadron_event;
mod left_squadron_event;
mod shared_bookmark_to_squadron_event;
mod squadron_created_event;
mod squadron_demotion_event;
mod squadron_promotion_event;
mod won_a_trophy_for_squadron_event;
mod carrier_decommision_event;
mod carrier_cancel_decommission_event;
mod carrier_ship_pack_event;
mod carrier_module_pack_event;
mod carrier_trade_order_event;
mod carrier_docking_permission_event;
mod carrier_name_changed_event;
mod book_dropship_event;
mod cancel_taxi_event;
mod cancel_dropship_event;
mod delete_suit_loadout_event;
mod drop_ship_deploy_event;
mod loadout_remove_module_event;
mod rename_suit_loadout_event;
mod sell_micro_resources_event;
mod sell_suit_event;
mod sell_weapon_event;
mod transfer_micro_resources_event;
mod trade_micro_resources_event;
mod upgrade_suit_event;
mod upgrade_weapon_event;
mod change_crew_role_event;
mod continued_event;
mod crew_launch_fighter_event;
mod crew_member_joins_event;
mod crew_member_quits_event;
mod crew_member_role_change_event;
mod datalink_voucher_event;
mod end_crew_session_event;
mod jet_cone_damage_event;
mod join_a_crew_event;
mod kick_crew_member_event;
mod quit_a_crew_event;
mod reboot_repair_event;

/// Enum containing all the possible events that can be found in a [JournalFile].
///
Expand Down
Loading

0 comments on commit 0db7921

Please sign in to comment.