Skip to content

Commit

Permalink
Added 'Hash' and 'Default' traits to some of our public API types.
Browse files Browse the repository at this point in the history
  • Loading branch information
InsertCreativityHere committed Dec 12, 2023
1 parent acd154f commit c24c6c4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/compilation_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ impl CompilationState {
}
}

impl Default for CompilationState {
fn default() -> Self {
Self::create()
}
}

// CompilationState is entirely self-contained, and hence safe to send between threads.
//
// Note that the `files` field of CompilationState is not self-contained on its own, since `SliceFile`
Expand Down
4 changes: 2 additions & 2 deletions src/slice_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use clap::{Parser, ValueEnum};

/// This struct is responsible for parsing the command line options common to all slice compilers.
/// The option parsing capabilities are generated on the struct by the `clap` macro.
#[derive(Debug, Default, Parser)]
#[derive(Debug, Default, Hash, Parser)]
#[command(rename_all = "kebab-case")]
pub struct SliceOptions {
/// List of Slice files to compile.
Expand Down Expand Up @@ -47,7 +47,7 @@ pub struct SliceOptions {
}

/// This enum is used to specify the format for emitted diagnostics.
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq, ValueEnum)]
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq, ValueEnum)]
pub enum DiagnosticFormat {
/// Diagnostics are printed to the console in an easily readable format with source code snippets when possible.
#[default]
Expand Down

0 comments on commit c24c6c4

Please sign in to comment.