-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #94 from nikstur/improve-reproducibility
Make it reproducible
- Loading branch information
Showing
8 changed files
with
117 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
use std::borrow::ToOwned; | ||
use std::collections::HashSet; | ||
use std::collections::BTreeSet; | ||
use std::fs; | ||
use std::path::Path; | ||
|
||
use anyhow::{Context, Result}; | ||
|
||
pub struct RuntimeInput(pub HashSet<String>); | ||
pub struct RuntimeInput(pub BTreeSet<String>); | ||
|
||
impl RuntimeInput { | ||
pub fn from_file(path: &Path) -> Result<Self> { | ||
let file_content = | ||
fs::read_to_string(path).with_context(|| format!("Failed to read {path:?}"))?; | ||
let set: HashSet<String> = file_content.lines().map(ToOwned::to_owned).collect(); | ||
let set: BTreeSet<String> = file_content.lines().map(ToOwned::to_owned).collect(); | ||
Ok(Self(set)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters