summaryrefslogtreecommitdiff
path: root/src/doc.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2023-06-21 05:35:40 +0300
committerLars Wirzenius <liw@liw.fi>2023-06-21 05:35:40 +0300
commit4694b6e7dcf29a01b47eee4a782e5b585cd80c39 (patch)
tree6c0e12feeacc6795726ee585625311c95b07d776 /src/doc.rs
parentd8e88bcdf5fddab3757d64cb7ca4c355480a8ca5 (diff)
downloadsubplot-4694b6e7dcf29a01b47eee4a782e5b585cd80c39.tar.gz
refactor: rename Document::files to ::embedded_files
This makes it more clear what kind of files we're talking about. The old name could've meant, say, the markdown files. Sponsored-by: author
Diffstat (limited to 'src/doc.rs')
-rw-r--r--src/doc.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/doc.rs b/src/doc.rs
index 583779b..d417e1d 100644
--- a/src/doc.rs
+++ b/src/doc.rs
@@ -245,7 +245,7 @@ impl Document {
}
/// Return list of files embeddedin the document.
- pub fn files(&self) -> &[EmbeddedFile] {
+ pub fn embedded_files(&self) -> &[EmbeddedFile] {
self.files.files()
}
@@ -275,7 +275,11 @@ impl Document {
// Check that all filenames for embedded files are unique.
fn check_filenames_are_unique(&self) -> Result<(), SubplotError> {
let mut known = HashSet::new();
- for filename in self.files().iter().map(|f| f.filename().to_lowercase()) {
+ for filename in self
+ .embedded_files()
+ .iter()
+ .map(|f| f.filename().to_lowercase())
+ {
if known.contains(&filename) {
return Err(SubplotError::DuplicateEmbeddedFilename(filename));
}
@@ -367,7 +371,7 @@ impl Document {
warnings: &mut Warnings,
) -> Result<bool, SubplotError> {
let filenames: HashSet<_> = self
- .files()
+ .embedded_files()
.iter()
.map(|f| f.filename().to_lowercase())
.collect();
@@ -404,7 +408,7 @@ impl Document {
warnings: &mut Warnings,
) -> Result<bool, SubplotError> {
let mut filenames: HashSet<_> = self
- .files()
+ .embedded_files()
.iter()
.map(|f| f.filename().to_lowercase())
.collect();