mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-24 06:34:09 +00:00
Refactor path ignore rule handling in Project and ServeSession
- Introduced a new method `path_ignore_rules` in the Project struct to streamline the creation of PathIgnoreRule instances. - Updated ServeSession and snapshot middleware to utilize the new method, improving code clarity and reducing duplication. - Removed redundant PathIgnoreRule mapping from multiple locations, enhancing maintainability.
This commit is contained in:
parent
89869f685d
commit
0243181731
3 changed files with 21 additions and 23 deletions
|
|
@ -17,7 +17,7 @@ use crate::{
|
|||
resolution::UnresolvedValue,
|
||||
snapshot::{
|
||||
InstanceContext, InstanceMetadata, InstanceSnapshot, InstanceWithMeta, InstigatingSource,
|
||||
PathIgnoreRule, SyncRule,
|
||||
SyncRule,
|
||||
},
|
||||
snapshot_middleware::Middleware,
|
||||
syncback::{
|
||||
|
|
@ -115,10 +115,7 @@ pub fn snapshot_project(
|
|||
let mut context = context.clone();
|
||||
context.clear_sync_rules();
|
||||
|
||||
let rules = project.glob_ignore_paths.iter().map(|glob| PathIgnoreRule {
|
||||
glob: glob.clone(),
|
||||
base_path: project.folder_location().to_path_buf(),
|
||||
});
|
||||
let rules = project.path_ignore_rules();
|
||||
|
||||
let sync_rules = project.sync_rules.iter().map(|rule| SyncRule {
|
||||
base_path: project.folder_location().to_path_buf(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue