From a4a68fdb178722e23e007b1f6bf72474caae4e97 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Thu, 9 Jan 2025 16:32:34 +0100 Subject: Rename SourceInfo::working_directory to directory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also documented the struct as it is exported. Signed-off-by: Miquel Sabaté Solà --- lib/xixanta/src/parser.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/xixanta/src/parser.rs') diff --git a/lib/xixanta/src/parser.rs b/lib/xixanta/src/parser.rs index 6ea23f4..2e938d3 100644 --- a/lib/xixanta/src/parser.rs +++ b/lib/xixanta/src/parser.rs @@ -59,8 +59,7 @@ impl Parser { // be initialized by the caller already). The `current_source` is simply // the one we push upon initialization. self.sources.push(SourceInfo { - working_directory: path::absolute(&source.working_directory) - .unwrap_or(source.working_directory), + directory: path::absolute(&source.directory).unwrap_or(source.directory), name: source.name, }); self.current_source = self.sources.len() - 1; @@ -631,7 +630,7 @@ impl Parser { let Some(current_source) = self.sources.get(self.current_source) else { panic!("mismatch between the number of sources and the current one"); }; - let abs_file = current_source.working_directory.join(file_path); + let abs_file = current_source.directory.join(file_path); // Validate that this is really a path that points to a file. let path = std::path::Path::new(&abs_file); @@ -680,7 +679,7 @@ impl Parser { parser.parse( file, SourceInfo { - working_directory: parent.to_path_buf(), + directory: parent.to_path_buf(), name: path.file_name().unwrap().to_str().unwrap().to_string(), }, )?; -- cgit v1.2.3