summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-09-06 18:20:21 +0300
committerLars Wirzenius <liw@liw.fi>2021-09-06 18:55:33 +0300
commitcca316622dfcfe07a3387a109a2ce6696c45722a (patch)
tree396eed986f0b8c7dd3b3063afd2893698112ca24 /src
parent5f37ad91b0370aa9fd441ec73c1937941006a9ea (diff)
downloadsubplot-cca316622dfcfe07a3387a109a2ce6696c45722a.tar.gz
fix: build resources into subplot binary even in Debian package
Once upon a time, in a galaxy far, far away, we decided to not build the share/* resource files into the subplot binary, when building it for a Debian package. Much later, we were much surprised when this was not the case and tests fail when run during the Debian package build. Because it's surprising to not build in the resources for a Debian package, we hereby undo that decision. Sponsored-by: author
Diffstat (limited to 'src')
-rw-r--r--src/resource.rs12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/resource.rs b/src/resource.rs
index cfcc63a..0149cd7 100644
--- a/src/resource.rs
+++ b/src/resource.rs
@@ -75,7 +75,6 @@ pub fn set_template(template: &str) {
///
/// First any path given to `--resources` in the order of the arguments
/// Second, it's relative to the input document.
-/// Third we look in `FALLBACK_PATH` if it's defined
/// Finally we check for an embedded file.
///
/// Then we repeat all the above, inserting the template name in the subpath
@@ -107,19 +106,10 @@ fn open<P: AsRef<Path>>(subpath: P) -> io::Result<Box<dyn Read>> {
}
}
-fn internal_fallback_path() -> Option<&'static Path> {
- match env!("FALLBACK_PATH") {
- "" => None,
- s => Some(Path::new(s)),
- }
-}
-
fn internal_open(subpath: &Path) -> io::Result<Box<dyn Read>> {
let search_paths = SEARCH_PATHS.lock().expect("Unable to lock SEARCH_PATHS");
let search_paths = search_paths.iter().map(|p| p.as_path());
- let search_paths = std::iter::empty()
- .chain(search_paths)
- .chain(internal_fallback_path());
+ let search_paths = std::iter::empty().chain(search_paths);
let mut ret = Err(io::Error::new(
io::ErrorKind::NotFound,
format!("Unable to find {} in resource paths", subpath.display()),