mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 05:51:39 +00:00
Refactor code for improved readability and consistency
- Simplified function calls and removed unnecessary line breaks in `change_processor.rs`, `rojo_ref.rs`, `syncback/meta.rs`, `syncback/mod.rs`, `syncback/ref_properties.rs`, and `web/api.rs` to enhance code clarity. - Updated test assertions in `two_way_sync.rs` for better readability by consolidating multiple lines into single assertions. These changes improve the overall maintainability and readability of the codebase.
This commit is contained in:
parent
b8c3520d25
commit
6f8e5a5cf2
7 changed files with 32 additions and 88 deletions
|
|
@ -135,16 +135,12 @@ pub fn update_ref_paths_in_file(
|
|||
let Some(path_str) = value.as_str() else {
|
||||
continue;
|
||||
};
|
||||
let Some(resolved) =
|
||||
crate::resolve_ref_path_to_absolute(path_str, source_abs)
|
||||
else {
|
||||
let Some(resolved) = crate::resolve_ref_path_to_absolute(path_str, source_abs) else {
|
||||
continue;
|
||||
};
|
||||
if resolved == old_prefix || resolved.starts_with(&old_prefix_slash) {
|
||||
let new_abs =
|
||||
format!("{new_prefix}{}", &resolved[old_prefix.len()..]);
|
||||
let new_relative =
|
||||
crate::compute_relative_ref_path(source_abs, &new_abs);
|
||||
let new_abs = format!("{new_prefix}{}", &resolved[old_prefix.len()..]);
|
||||
let new_relative = crate::compute_relative_ref_path(source_abs, &new_abs);
|
||||
*value = serde_json::Value::String(new_relative);
|
||||
updated = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue