diff options
author | Melody Horn <melody@boringcactus.com> | 2021-03-27 17:02:11 -0600 |
---|---|---|
committer | Melody Horn <melody@boringcactus.com> | 2021-03-27 17:02:11 -0600 |
commit | 86c271eb2f9c0b3e1e2a35d26a2dca37435b5b8c (patch) | |
tree | 5adc564056cf349793f4b9ffd6c70bf908117cc1 /src/makefile/target.rs | |
parent | 5197d769bb2fea50975122a4ebba89c07c712839 (diff) | |
download | makers-86c271eb2f9c0b3e1e2a35d26a2dca37435b5b8c.tar.gz makers-86c271eb2f9c0b3e1e2a35d26a2dca37435b5b8c.zip |
why `pub` when you can `pub(crate)`?
Diffstat (limited to 'src/makefile/target.rs')
-rw-r--r-- | src/makefile/target.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/makefile/target.rs b/src/makefile/target.rs index 1fbc75b..443eee5 100644 --- a/src/makefile/target.rs +++ b/src/makefile/target.rs @@ -8,11 +8,11 @@ use crate::makefile::command_line::CommandLine; use super::Makefile; #[derive(PartialEq, Eq, Clone, Debug)] -pub struct Target { - pub name: String, - pub prerequisites: Vec<String>, - pub commands: Vec<CommandLine>, - pub already_updated: Cell<bool>, +pub(crate) struct Target { + pub(crate) name: String, + pub(crate) prerequisites: Vec<String>, + pub(crate) commands: Vec<CommandLine>, + pub(crate) already_updated: Cell<bool>, } impl Target { @@ -22,7 +22,7 @@ impl Target { .ok() } - pub fn newer_than(&self, other: &Target) -> Option<bool> { + pub(crate) fn newer_than(&self, other: &Target) -> Option<bool> { let self_updated = self.already_updated.get(); let other_updated = other.already_updated.get(); Some(match (self.modified_time(), other.modified_time()) { @@ -48,7 +48,7 @@ impl Target { exists && newer_than_all_dependencies } - pub fn update(&self, file: &Makefile) { + pub(crate) fn update(&self, file: &Makefile) { for prereq in &self.prerequisites { file.update_target(prereq); } |