aboutsummaryrefslogtreecommitdiff
path: root/src/makefile/mod.rs
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2021-03-31 13:23:32 -0600
committerMelody Horn <melody@boringcactus.com>2021-03-31 13:23:32 -0600
commit9666eea62b8cf763027d1f01acbb403c1c6097e0 (patch)
treefb7f825089323ac8ef19203e7ff80f41156ce01b /src/makefile/mod.rs
parent9d3e0824a0966c648e951e5928c241700ee931fb (diff)
downloadmakers-9666eea62b8cf763027d1f01acbb403c1c6097e0.tar.gz
makers-9666eea62b8cf763027d1f01acbb403c1c6097e0.zip
issuing correction on a previous post of mine, regarding pub(crate)
Diffstat (limited to 'src/makefile/mod.rs')
-rw-r--r--src/makefile/mod.rs14
1 files changed, 7 insertions, 7 deletions
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<InferenceRule>,
macros: MacroSet<'static, 'static>,
targets: RefCell<HashMap<String, Rc<RefCell<Target>>>>,
- pub(crate) first_non_special_target: Option<String>,
+ pub first_non_special_target: Option<String>,
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<Path>) -> anyhow::Result<()> {
+ pub fn and_read_file(&mut self, path: impl AsRef<Path>) -> 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<Rc<RefCell<Target>>> {
+ pub fn get_target(&self, name: &str) -> anyhow::Result<Rc<RefCell<Target>>> {
// 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)
}