From 9666eea62b8cf763027d1f01acbb403c1c6097e0 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Wed, 31 Mar 2021 13:23:32 -0600 Subject: issuing correction on a previous post of mine, regarding pub(crate) --- src/makefile/mod.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/makefile/mod.rs') diff --git a/src/makefile/mod.rs b/src/makefile/mod.rs index 270dd46..d9c9b46 100644 --- a/src/makefile/mod.rs +++ b/src/makefile/mod.rs @@ -85,17 +85,17 @@ fn inference_match<'a>( } } -pub(crate) struct Makefile<'a> { +pub struct Makefile<'a> { inference_rules: Vec, macros: MacroSet<'static, 'static>, targets: RefCell>>>, - pub(crate) first_non_special_target: Option, + pub first_non_special_target: Option, args: &'a Args, // TODO borrow warnings from Python version } impl<'a> Makefile<'a> { - pub(crate) fn new(args: &'a Args) -> Self { + pub fn new(args: &'a Args) -> Self { let mut inference_rules = vec![]; let mut macros = MacroSet::new(); let mut targets = HashMap::new(); @@ -132,7 +132,7 @@ impl<'a> Makefile<'a> { } } - pub(crate) fn and_read_file(&mut self, path: impl AsRef) -> anyhow::Result<()> { + pub fn and_read_file(&mut self, path: impl AsRef) -> anyhow::Result<()> { let file = File::open(path); // TODO handle errors let file = file.context("couldn't open makefile!")?; @@ -140,7 +140,7 @@ impl<'a> Makefile<'a> { self.and_read(file_reader) } - pub(crate) fn and_read(&mut self, source: impl BufRead) -> anyhow::Result<()> { + pub fn and_read(&mut self, source: impl BufRead) -> anyhow::Result<()> { let mut lines_iter = source .lines() .enumerate() @@ -416,7 +416,7 @@ impl<'a> Makefile<'a> { } } - pub(crate) fn get_target(&self, name: &str) -> anyhow::Result>> { + pub fn get_target(&self, name: &str) -> anyhow::Result>> { // TODO implement .POSIX let follow_gnu = true; @@ -514,7 +514,7 @@ impl<'a> Makefile<'a> { Ok(targets.get(name).context("Target not found!")?.clone()) } - pub(crate) fn update_target(&self, name: &str) -> anyhow::Result<()> { + pub fn update_target(&self, name: &str) -> anyhow::Result<()> { self.get_target(name)?.borrow().update(self) } -- cgit v1.2.3