aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-class-map-generator
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-19 00:10:22 +0900
committernsfisis <nsfisis@gmail.com>2026-05-19 00:11:03 +0900
commitc839244d8d09f3036ebfee8eef7eb6b147e593ab (patch)
treefe48c94f2c2e62468beef5ff1a8f3cff6adeef4f /crates/shirabe-class-map-generator
parent48839250146b217e2756ed3c0e624fd341b54d6c (diff)
downloadphp-shirabe-c839244d8d09f3036ebfee8eef7eb6b147e593ab.tar.gz
php-shirabe-c839244d8d09f3036ebfee8eef7eb6b147e593ab.tar.zst
php-shirabe-c839244d8d09f3036ebfee8eef7eb6b147e593ab.zip
fix(compile): fix various compile errors
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-class-map-generator')
-rw-r--r--crates/shirabe-class-map-generator/src/class_map_generator.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/shirabe-class-map-generator/src/class_map_generator.rs b/crates/shirabe-class-map-generator/src/class_map_generator.rs
index 733915e..a49ce66 100644
--- a/crates/shirabe-class-map-generator/src/class_map_generator.rs
+++ b/crates/shirabe-class-map-generator/src/class_map_generator.rs
@@ -45,7 +45,7 @@ impl ClassMapGenerator {
/// When calling scanPaths repeatedly with paths that may overlap, calling this will ensure that the same class is never scanned twice
pub fn avoid_duplicate_scans(&mut self, scanned_files: Option<FileList>) -> &mut Self {
- self.scanned_files = Some(scanned_files.unwrap_or_else(FileList::new));
+ self.scanned_files = Some(scanned_files.unwrap_or_default());
self
}
@@ -60,6 +60,11 @@ impl ClassMapGenerator {
&self.class_map
}
+ /// Take ownership of the inner ClassMap, leaving a default in its place.
+ pub fn take_class_map(&mut self) -> ClassMap {
+ std::mem::take(&mut self.class_map)
+ }
+
/// Iterate over all files in the given directory searching for classes
pub fn scan_paths(
&mut self,