Skip to content

Commit 378f551

Browse files
committed
chore: code review feedback.
1 parent 0f51cc6 commit 378f551

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

wdl-engine/src/eval.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -640,8 +640,11 @@ pub struct InputTrie {
640640
}
641641

642642
impl InputTrie {
643-
/// Constructs a new inputs trie with the given guest inputs directory.
644-
pub fn new(guest_inputs_dir: &'static str) -> Self {
643+
/// Constructs a new inputs trie with a guest inputs directory.
644+
///
645+
/// Inputs with a host path will be mapped to a guest path relative to the
646+
/// guest inputs directory.
647+
pub fn new_with_guest_dir(guest_inputs_dir: &'static str) -> Self {
645648
Self {
646649
guest_inputs_dir: Some(guest_inputs_dir),
647650
..Default::default()
@@ -650,6 +653,11 @@ impl InputTrie {
650653

651654
/// Inserts a new input into the trie.
652655
///
656+
/// The `path` parameter is a `File` or `Directory` value (as a string) to
657+
/// treat as an input.
658+
///
659+
/// It may be either a local or remote path.
660+
///
653661
/// Returns `Ok(Some(_))` if an input was added.
654662
///
655663
/// Returns `Ok(None)` if the provided path was already a guest input path
@@ -939,7 +947,7 @@ mod test {
939947
#[cfg(unix)]
940948
#[test]
941949
fn non_empty_trie_unix() {
942-
let mut trie = InputTrie::new("/inputs");
950+
let mut trie = InputTrie::new_with_guest_dir("/inputs");
943951
trie.insert(InputKind::Directory, "/").unwrap().unwrap();
944952
trie.insert(InputKind::File, "/foo/bar/foo.txt")
945953
.unwrap()
@@ -1029,7 +1037,7 @@ mod test {
10291037
#[cfg(windows)]
10301038
#[test]
10311039
fn non_empty_trie_windows() {
1032-
let mut trie = InputTrie::new("/inputs");
1040+
let mut trie = InputTrie::new_with_guest_dir("/inputs");
10331041
trie.insert(InputKind::Directory, "C:\\").unwrap().unwrap();
10341042
trie.insert(InputKind::File, "C:\\foo\\bar\\foo.txt")
10351043
.unwrap()

wdl-engine/src/eval/v1/task.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ impl<'a> State<'a> {
632632
];
633633

634634
let mut inputs = if let Some(roots) = guest_roots {
635-
InputTrie::new(roots.inputs_dir)
635+
InputTrie::new_with_guest_dir(roots.inputs_dir)
636636
} else {
637637
InputTrie::default()
638638
};

0 commit comments

Comments
 (0)