Constant cache_buster::CACHE_BUSTER_DATA_FILE [−][src]
pub const CACHE_BUSTER_DATA_FILE: &str = "./src/cache_buster_data.json";
Expand description
file to which filemap is written during compilation +
Constant cache_buster::CACHE_BUSTER_DATA_FILE [−][src]
pub const CACHE_BUSTER_DATA_FILE: &str = "./src/cache_buster_data.json";
Expand description
file to which filemap is written during compilation
include this to .gitignore
Module cache_buster::filemap [−][src]
Expand description
Module describing runtime compoenet for fetching modified filenames
+Module cache_buster::filemap [−][src]
Expand description
Module describing runtime compoenet for fetching modified filenames
Add the following tou your program to load the filemap during compiletime:
use cache_buster::Files;
diff --git a/cache_buster/filemap/struct.Files.html b/cache_buster/filemap/struct.Files.html
index 5b82bb5..6ba59e3 100644
--- a/cache_buster/filemap/struct.Files.html
+++ b/cache_buster/filemap/struct.Files.html
@@ -1,10 +1,10 @@
Files in cache_buster::filemap - Rust Struct cache_buster::filemap::Files [−][src]
pub struct Files { /* fields omitted */ }
Expand description
Filemap struct
maps original names to generated names
Implementations
Load filemap in main program. Should be called from main program
-
Get relative file path
If the modified filename path is ./prod/test.randomhash.svg
, it will
output /test.randomhash.svg
. For full path, see get_full_path.
-
Get file path
+Trait Implementations
Returns a copy of the value. Read more
diff --git a/cache_buster/index.html b/cache_buster/index.html
index 1ef4b76..3da0d3b 100644
--- a/cache_buster/index.html
+++ b/cache_buster/index.html
@@ -1,4 +1,4 @@
-cache_buster - Rust Crate cache_buster[−][src]
Expand description
What is cache busting?
+cache_buster - Rust Crate cache_buster[−][src]
Expand description
What is cache busting?
To optimise network load time, browsers cache static files. Caching
greatly improves performance but how do you inform browsers to
invalidate cache when your files have changed?
@@ -30,7 +30,6 @@ a file that it doesn’t have. Pretty neat, isn’t it?
.source("./dist")
.result("./prod")
.mime_types(types)
- .copy(true)
.follow_links(true)
.build()
.unwrap();
diff --git a/cache_buster/processor/enum.BusterBuilderError.html b/cache_buster/processor/enum.BusterBuilderError.html
index 323244b..0e9c5c4 100644
--- a/cache_buster/processor/enum.BusterBuilderError.html
+++ b/cache_buster/processor/enum.BusterBuilderError.html
@@ -1,18 +1,18 @@
-BusterBuilderError in cache_buster::processor - Rust Enum cache_buster::processor::BusterBuilderError [−][src]
#[non_exhaustive]
+BusterBuilderError in cache_buster::processor - Rust Enum cache_buster::processor::BusterBuilderError [−][src]
#[non_exhaustive]
pub enum BusterBuilderError {
UninitializedField(&'static str),
ValidationError(String),
}
Expand description
Error type for BusterBuilder
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.UninitializedField(&'static str)
Uninitialized field
Tuple Fields of UninitializedField
0: &'static str
ValidationError(String)
Custom validation error
-Tuple Fields of ValidationError
0: String
Trait Implementations
The lower-level source of this error, if any. Read more
+Tuple Fields of ValidationError
0: String
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for BusterBuilderError
impl Send for BusterBuilderError
impl Sync for BusterBuilderError
impl Unpin for BusterBuilderError
impl UnwindSafe for BusterBuilderError
Blanket Implementations
Mutably borrows from an owned value. Read more
diff --git a/cache_buster/processor/enum.NoHashCategory.html b/cache_buster/processor/enum.NoHashCategory.html
index 69636f3..34889c9 100644
--- a/cache_buster/processor/enum.NoHashCategory.html
+++ b/cache_buster/processor/enum.NoHashCategory.html
@@ -1,4 +1,4 @@
-NoHashCategory in cache_buster::processor - Rust Enum cache_buster::processor::NoHashCategory [−][src]
pub enum NoHashCategory<'a> {
+NoHashCategory in cache_buster::processor - Rust Enum cache_buster::processor::NoHashCategory [−][src]
Expand description
Items to avoid hash calculation.
@@ -12,9 +12,9 @@ beyond the abilities of cache_buster
.
let files = NoHashCategory::FileExtentions(vec!["swagger-ui-bundle.js", "favicon-16x16.png"]);
Variants
vector of file extensions that should be avoided for hash processing
list of file paths that should be avoided for file processing
-Trait Implementations
Returns a copy of the value. Read more
+Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for NoHashCategory<'a>
impl<'a> Send for NoHashCategory<'a>
impl<'a> Sync for NoHashCategory<'a>
impl<'a> Unpin for NoHashCategory<'a>
impl<'a> UnwindSafe for NoHashCategory<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more
diff --git a/cache_buster/processor/index.html b/cache_buster/processor/index.html
index 82bc3f2..aaf9089 100644
--- a/cache_buster/processor/index.html
+++ b/cache_buster/processor/index.html
@@ -1,4 +1,4 @@
-cache_buster::processor - Rust Module cache_buster::processor [−][src]
Expand description
Module describing file processor that changes filenames to setup cache-busting
+cache_buster::processor - Rust Module cache_buster::processor [−][src]
Expand description
Module describing file processor that changes filenames to setup cache-busting
Run the following during build using build.rs
:
use cache_buster::BusterBuilder;
@@ -16,7 +16,6 @@
.source("./dist")
.result("./prod")
.mime_types(types)
- .copy(true)
.follow_links(true)
.build()
.unwrap();
diff --git a/cache_buster/processor/struct.Buster.html b/cache_buster/processor/struct.Buster.html
index 5a73b17..11c8eeb 100644
--- a/cache_buster/processor/struct.Buster.html
+++ b/cache_buster/processor/struct.Buster.html
@@ -1,9 +1,9 @@
-Buster in cache_buster::processor - Rust Struct cache_buster::processor::Buster [−][src]
pub struct Buster<'a> { /* fields omitted */ }
Expand description
Configuration for setting up cache-busting
-Implementations
Processes files.
+Buster in cache_buster::processor - Rust Struct cache_buster::processor::Buster [−][src]
pub struct Buster<'a> { /* fields omitted */ }
Expand description
Configuration for setting up cache-busting
+Implementations
Trait Implementations
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for Buster<'a>
impl<'a> UnwindSafe for Buster<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more
diff --git a/cache_buster/processor/struct.BusterBuilder.html b/cache_buster/processor/struct.BusterBuilder.html
index e1de168..6d9754f 100644
--- a/cache_buster/processor/struct.BusterBuilder.html
+++ b/cache_buster/processor/struct.BusterBuilder.html
@@ -1,19 +1,18 @@
-BusterBuilder in cache_buster::processor - Rust Struct cache_buster::processor::BusterBuilder [−][src]
pub struct BusterBuilder<'a> { /* fields omitted */ }
Expand description
Builder for Buster
.
-Implementations
mime_types for hashing
-
directory for writing results
-
copy other non-hashed files from source dire to result dir?
-
follow symlinks?
-
exclude these files for hashing.
+
BusterBuilder in cache_buster::processor - Rust Struct cache_buster::processor::BusterBuilder [−][src]
pub struct BusterBuilder<'a> { /* fields omitted */ }
Expand description
Builder for Buster
.
+Implementations
mime_types for hashing
+
directory for writing results
+
follow symlinks?
+
exclude these files for hashing.
They will be copied over without including a hash in the filename
Path should be relative to [self.source]
-
Builds a new Buster
.
+Trait Implementations
Returns a copy of the value. Read more
+Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for BusterBuilder<'a>
impl<'a> Send for BusterBuilder<'a>
impl<'a> Sync for BusterBuilder<'a>
impl<'a> Unpin for BusterBuilder<'a>
impl<'a> UnwindSafe for BusterBuilder<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more
diff --git a/search-index.js b/search-index.js
index 704e323..a0ff851 100644
--- a/search-index.js
+++ b/search-index.js
@@ -1,5 +1,5 @@
var searchIndex = JSON.parse('{\
"actix_web":{"doc":"","t":[3,17,3,3,3,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,3,11,11,11,11,11,11,11,11,11,11,11,5,5,0,11,11,11,11,11,11,11,11,11,11,11,5,11,11,11,3,5,3,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,5],"n":["Asset","CACHE_AGE","FILES","Favicons","INDEX","__private_field","__private_field","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","deref","deref","favicons","from","from","from","from","from","from","from","get","get","get","get","handle_assets","handle_favicons","index","into","into","into","into","into","into","into","iter","iter","iter","iter","main","register","register","register","serve_index","services","static_files","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","get_index"],"q":["actix_web","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","actix_web::index"],"d":["Embed files. Or not. You can also read files dynamically","Set a riddicolusly high cache age","create filemap","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Get an embedded file and its metadata.","Get an embedded file and its metadata.","","","","","","","","","","","","","Iterates over the file paths in the folder.","","Iterates over the file paths in the folder.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,0,0,0,0,1,2,1,2,3,4,5,6,7,1,2,3,4,5,6,7,1,2,0,1,2,3,4,5,6,7,3,3,6,6,0,0,0,1,2,3,4,5,6,7,3,3,6,6,0,4,5,7,0,0,0,1,2,3,4,5,6,7,1,2,3,4,5,6,7,1,2,3,4,5,6,7,1,2,3,4,5,6,7,0],"f":[null,null,null,null,null,null,null,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["files",3]],[[],["string",3]],null,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[["str",15]],[["option",4,["embeddedfile"]],["embeddedfile",3]]],[[["str",15]],[["option",4,["embeddedfile"]],["embeddedfile",3]]],[[["str",15]],[["option",4,["embeddedfile"]],["embeddedfile",3]]],[[["str",15]],[["option",4,["embeddedfile"]],["embeddedfile",3]]],[[["str",15]],["httpresponse",3]],[[["str",15]],["httpresponse",3]],null,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["filenames",4]],[[]],[[],["filenames",4]],[[]],[[],["result",6]],[[["appservice",3]]],[[["appservice",3]]],[[["appservice",3]]],null,[[["serviceconfig",3]]],null,[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["string",3]]],"p":[[3,"FILES"],[3,"INDEX"],[3,"Asset"],[3,"static_files"],[3,"serve_index"],[3,"Favicons"],[3,"favicons"]]},\
-"cache_buster":{"doc":"What is cache busting?","t":[17,0,0,3,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,3,3,4,13,13,4,13,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12],"n":["CACHE_BUSTER_DATA_FILE","filemap","processor","Files","borrow","borrow_mut","clone","clone_into","deserialize","eq","fmt","from","get","get_full_path","into","ne","new","serialize","to_owned","try_from","try_into","type_id","Buster","BusterBuilder","BusterBuilderError","FileExtentions","FilePaths","NoHashCategory","UninitializedField","ValidationError","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build","clone","clone","clone","clone_into","clone_into","clone_into","copy","default","fmt","fmt","fmt","fmt","follow_links","from","from","from","from","from","from","into","into","into","into","mime_types","no_hash","prefix","process","result","source","to_owned","to_owned","to_owned","to_string","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","0","0","0","0"],"q":["cache_buster","","","cache_buster::filemap","","","","","","","","","","","","","","","","","","","cache_buster::processor","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","cache_buster::processor::BusterBuilderError","","cache_buster::processor::NoHashCategory",""],"d":["file to which filemap is written during compilation …","Module describing runtime compoenet for fetching modified …","Module describing file processor that changes filenames to …","Filemap struct","","","","","","","","","Get relative file path","Get file path","","","Load filemap in main program. Should be called from main …","","","","","","Configuration for setting up cache-busting","Builder for Buster
.","Error type for BusterBuilder","vector of file extensions that should be avoided for hash …","list of file paths that should be avoided for file …","Items to avoid hash calculation.","Uninitialized field","Custom validation error","","","","","","","","","Builds a new Buster
.","","","","","","","copy other non-hashed files from source dire to result dir?","","","","","","follow symlinks?","","","","","","","","","","","mime_types for hashing","exclude these files for hashing. They will be copied over …","route prefixes","Processes files.","directory for writing results","source directory","","","","","","","","","","","","","","","","","","","",""],"i":[0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,2,2,0,3,3,2,4,3,5,2,4,3,5,4,2,4,5,2,4,5,4,4,2,3,3,5,4,2,4,3,3,3,5,2,4,3,5,4,4,4,5,4,4,2,4,5,3,2,4,3,5,2,4,3,5,2,4,3,5,6,7,8,9],"f":[null,null,null,null,[[]],[[]],[[],["files",3]],[[]],[[],["result",4]],[[["files",3]],["bool",15]],[[["formatter",3]],["result",6]],[[]],[[],[["option",4,["str"]],["str",15]]],[[],[["string",3],["option",4,["string"]]]],[[]],[[["files",3]],["bool",15]],[[["str",15]]],[[],["result",4]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],null,null,null,null,null,null,null,null,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],[["result",4,["buster","busterbuildererror"]],["buster",3],["busterbuildererror",4]]],[[],["nohashcategory",4]],[[],["busterbuilder",3]],[[],["buster",3]],[[]],[[]],[[]],[[["bool",15]]],[[]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["bool",15]]],[[]],[[]],[[["string",3]]],[[]],[[["uninitializedfielderror",3]]],[[]],[[]],[[]],[[]],[[]],[[["vec",3,["mime"]],["into",8,["vec"]]]],[[["vec",3,["nohashcategory"]],["nohashcategory",4]]],[[["into",8,["string"]],["string",3]]],[[],[["result",4,["error"]],["error",3]]],[[["into",8,["string"]],["string",3]]],[[["into",8,["string"]],["string",3]]],[[]],[[]],[[]],[[],["string",3]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],null,null,null,null],"p":[[3,"Files"],[4,"NoHashCategory"],[4,"BusterBuilderError"],[3,"BusterBuilder"],[3,"Buster"],[13,"UninitializedField"],[13,"ValidationError"],[13,"FileExtentions"],[13,"FilePaths"]]}\
+"cache_buster":{"doc":"What is cache busting?","t":[17,0,0,3,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,3,3,4,13,13,4,13,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12],"n":["CACHE_BUSTER_DATA_FILE","filemap","processor","Files","borrow","borrow_mut","clone","clone_into","deserialize","eq","fmt","from","get","get_full_path","into","ne","new","serialize","to_owned","try_from","try_into","type_id","Buster","BusterBuilder","BusterBuilderError","FileExtentions","FilePaths","NoHashCategory","UninitializedField","ValidationError","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build","clone","clone","clone","clone_into","clone_into","clone_into","default","fmt","fmt","fmt","fmt","follow_links","from","from","from","from","from","from","into","into","into","into","mime_types","no_hash","prefix","process","result","source","to_owned","to_owned","to_owned","to_string","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","0","0","0","0"],"q":["cache_buster","","","cache_buster::filemap","","","","","","","","","","","","","","","","","","","cache_buster::processor","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","cache_buster::processor::BusterBuilderError","","cache_buster::processor::NoHashCategory",""],"d":["file to which filemap is written during compilation …","Module describing runtime compoenet for fetching modified …","Module describing file processor that changes filenames to …","Filemap struct","","","","","","","","","Get relative file path","Get file path","","","Load filemap in main program. Should be called from main …","","","","","","Configuration for setting up cache-busting","Builder for Buster
.","Error type for BusterBuilder","vector of file extensions that should be avoided for hash …","list of file paths that should be avoided for file …","Items to avoid hash calculation.","Uninitialized field","Custom validation error","","","","","","","","","Builds a new Buster
.","","","","","","","","","","","","follow symlinks?","","","","","","","","","","","mime_types for hashing","exclude these files for hashing. They will be copied over …","route prefixes","Processes files.","directory for writing results","source directory","","","","","","","","","","","","","","","","","","","",""],"i":[0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,2,2,0,3,3,2,4,3,5,2,4,3,5,4,2,4,5,2,4,5,4,2,3,3,5,4,2,4,3,3,3,5,2,4,3,5,4,4,4,5,4,4,2,4,5,3,2,4,3,5,2,4,3,5,2,4,3,5,6,7,8,9],"f":[null,null,null,null,[[]],[[]],[[],["files",3]],[[]],[[],["result",4]],[[["files",3]],["bool",15]],[[["formatter",3]],["result",6]],[[]],[[],[["str",15],["option",4,["str"]]]],[[],[["option",4,["string"]],["string",3]]],[[]],[[["files",3]],["bool",15]],[[["str",15]]],[[],["result",4]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],null,null,null,null,null,null,null,null,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],[["busterbuildererror",4],["result",4,["buster","busterbuildererror"]],["buster",3]]],[[],["nohashcategory",4]],[[],["busterbuilder",3]],[[],["buster",3]],[[]],[[]],[[]],[[]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["bool",15]]],[[]],[[]],[[["string",3]]],[[]],[[["uninitializedfielderror",3]]],[[]],[[]],[[]],[[]],[[]],[[["into",8,["vec"]],["vec",3,["mime"]]]],[[["vec",3,["nohashcategory"]],["nohashcategory",4]]],[[["string",3],["into",8,["string"]]]],[[],[["result",4,["error"]],["error",3]]],[[["string",3],["into",8,["string"]]]],[[["string",3],["into",8,["string"]]]],[[]],[[]],[[]],[[],["string",3]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],null,null,null,null],"p":[[3,"Files"],[4,"NoHashCategory"],[4,"BusterBuilderError"],[3,"BusterBuilder"],[3,"Buster"],[13,"UninitializedField"],[13,"ValidationError"],[13,"FileExtentions"],[13,"FilePaths"]]}\
}');
if (window.initSearch) {window.initSearch(searchIndex)};
\ No newline at end of file
diff --git a/src/cache_buster/filemap.rs.html b/src/cache_buster/filemap.rs.html
index 8f11ffa..bd74593 100644
--- a/src/cache_buster/filemap.rs.html
+++ b/src/cache_buster/filemap.rs.html
@@ -160,8 +160,6 @@
160
161
162
-163
-164
/*
* Copyright (C) 2021 Aravinth Manivannan <realaravinth@batsense.net>
*
@@ -195,7 +193,7 @@
impl Files {
/// Load filemap in main program. Should be called from main program
pub fn new(map: &str) -> Self {
- let res: Files = serde_json::from_str(&map).unwrap();
+ let res: Files = serde_json::from_str(map).unwrap();
res
}
@@ -203,7 +201,7 @@
///
/// If the modified filename path is `./prod/test.randomhash.svg`, it will
/// output `/test.randomhash.svg`. For full path, see [get_full_path][Self::get_full_path].
- pub fn get<'a, 'b>(&'b self, path: impl AsRef<str>) -> Option<&'b str> {
+ pub fn get(&self, path: impl AsRef<str>) -> Option<&str> {
if let Some(path) = self.map.get(path.as_ref()) {
Some(&path[self.base_dir.len()..])
// Some(&path)
@@ -216,7 +214,7 @@
///
/// If the modified filename path is `./prod/test.randomhash.svg`, it will
/// output `/prod/test.randomhash.svg`. For relative path, see [get][Self::get].
- pub fn get_full_path<'a, 'b>(&'b self, path: impl AsRef<str>) -> Option<&'b String> {
+ pub fn get_full_path(&self, path: impl AsRef<str>) -> Option<&String> {
self.map.get(path.as_ref())
}
}
@@ -245,7 +243,6 @@
.source("./dist")
.result("/tmp/prodsd2")
.mime_types(types)
- .copy(true)
.follow_links(true)
.build()
.unwrap();
@@ -290,7 +287,6 @@
.source("./dist")
.result("/tmp/prod5")
.mime_types(types)
- .copy(true)
.follow_links(true)
.build()
.unwrap();
diff --git a/src/cache_buster/lib.rs.html b/src/cache_buster/lib.rs.html
index 1dec492..2016bd2 100644
--- a/src/cache_buster/lib.rs.html
+++ b/src/cache_buster/lib.rs.html
@@ -70,7 +70,6 @@
70
71
72
-73
/*
* Copyright (C) 2021 Aravinth Manivannan <realaravinth@batsense.net>
*
@@ -113,7 +112,6 @@
//! .source("./dist")
//! .result("./prod")
//! .mime_types(types)
-//! .copy(true)
//! .follow_links(true)
//! .build()
//! .unwrap();
diff --git a/src/cache_buster/processor.rs.html b/src/cache_buster/processor.rs.html
index abc4350..5ecfdcd 100644
--- a/src/cache_buster/processor.rs.html
+++ b/src/cache_buster/processor.rs.html
@@ -525,30 +525,6 @@
525
526
527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
/*
* Copyright (C) 2021 Aravinth Manivannan <realaravinth@batsense.net>
*
@@ -576,7 +552,6 @@
//! .source("./dist")
//! .result("./prod")
//! .mime_types(types)
-//! .copy(true)
//! .follow_links(true)
//! .build()
//! .unwrap();
@@ -634,8 +609,6 @@
#[builder(setter(into, strip_option), default)]
/// route prefixes
prefix: Option<String>,
- /// copy other non-hashed files from source dire to result dir?
- copy: bool,
/// follow symlinks?
follow_links: bool,
/// exclude these files for hashing.
@@ -698,7 +671,7 @@
let mut file_map: Files = Files::new(&self.result);
let mut process_worker = |path: &Path| {
- let contents = Self::read_to_string(&path).unwrap();
+ let contents = Self::read_to_string(path).unwrap();
let hash = Self::hasher(&contents);
let get_name = |no_hash: bool| -> String {
@@ -741,25 +714,8 @@
let new_name = get_name(no_hash_status);
- // let new_name = if self.no_hash.iter().any(|no_hash| {
- // let no_hash = Path::new(&self.source).join(&no_hash);
- // no_hash == path
- // }) {
- // format!(
- // "{}.{}",
- // path.file_stem().unwrap().to_str().unwrap(),
- // path.extension().unwrap().to_str().unwrap()
- // )
- // } else {
- // format!(
- // "{}.{}.{}",
- // path.file_stem().unwrap().to_str().unwrap(),
- // hash,
- // path.extension().unwrap().to_str().unwrap()
- // )
- // };
self.copy(path, &new_name);
- let (source, destination) = self.gen_map(path, &&new_name);
+ let (source, destination) = self.gen_map(path, &new_name);
let _ = file_map.add(
source.to_str().unwrap().into(),
destination.to_str().unwrap().into(),
@@ -784,11 +740,11 @@
panic!("couldn't resolve MIME for file: {:?}", &path)
});
if &file_mime == mime_type {
- process_worker(&path);
+ process_worker(path);
}
}
}
- None => process_worker(&path),
+ None => process_worker(path),
}
}
}
@@ -847,7 +803,7 @@
let entry_path = Path::new(&entry_path);
if entry_path.is_dir() && path != entry_path {
- Self::create_dir_structure(&self, entry_path)?;
+ Self::create_dir_structure(self, entry_path)?;
} else if entry_path.is_dir() {
let rel_location = entry_path.strip_prefix(&self.source).unwrap();
let destination = Path::new(&self.result).join(rel_location);
@@ -912,7 +868,7 @@
pub mod tests {
use super::*;
- pub fn cleanup(config: &Buster) {
+ pub fn cleanup(config: &Buster<'_>) {
let _ = fs::remove_dir_all(&config.result);
delete_file();
}
@@ -937,7 +893,6 @@
.source("./dist")
.result("/tmp/prod2i")
.mime_types(types)
- .copy(true)
.follow_links(true)
.prefix("/test")
.no_hash(vec![no_hash.clone()])
@@ -959,7 +914,6 @@
let config = BusterBuilder::default()
.source("./dist")
.result("/tmp/prod2ii")
- .copy(true)
.follow_links(true)
.no_hash(vec![no_hash.clone()])
.build()
@@ -1010,7 +964,6 @@
.source("./dist")
.result("/tmp/prod2i")
.mime_types(types)
- .copy(true)
.follow_links(true)
.prefix("/test")
.build()
@@ -1051,7 +1004,6 @@
let config = BusterBuilder::default()
.source("./dist")
.result("/tmp/prodnohashextension")
- .copy(true)
.follow_links(true)
.no_hash(no_hash.clone())
.build()