diff --git a/crates/doc/src/xml_id.rs b/crates/doc/src/xml_id.rs index 6bdb170b..4aa35f02 100644 --- a/crates/doc/src/xml_id.rs +++ b/crates/doc/src/xml_id.rs @@ -91,11 +91,7 @@ fn strip_unique(id: &str) -> &str { return id; }; let digits = body.get(at + 1..).unwrap_or_default(); - if digits.len() >= 20 && digits.bytes().all(|b| b.is_ascii_digit()) { - body.get(..at).unwrap_or(id) - } else { - id - } + if digits.len() >= 20 && digits.bytes().all(|b| b.is_ascii_digit()) { body.get(..at).unwrap_or(id) } else { id } } #[cfg(test)] diff --git a/crates/engine/src/cmd/layer.rs b/crates/engine/src/cmd/layer.rs index b174647e..e8ec7d52 100644 --- a/crates/engine/src/cmd/layer.rs +++ b/crates/engine/src/cmd/layer.rs @@ -377,10 +377,7 @@ fn check_options(cmd: &str, p: &Value, xml_id: bool) -> Result<()> { && let Some(name) = str_param(p, "name").filter(|n| !n.trim().is_empty()) && !vectorcraft_doc::xml_id::is_valid(name) { - return Err(bad( - cmd, - "Identify Objects By is XML ID: the name must be a valid XML ID (start with a letter, underscore or colon; no spaces)", - )); + return Err(bad(cmd, "Identify Objects By is XML ID: the name must be a valid XML ID (start with a letter, underscore or colon; no spaces)")); } Ok(()) } diff --git a/crates/ui-egui/src/dialogs/layer_options.rs b/crates/ui-egui/src/dialogs/layer_options.rs index 0ba10202..119d5e3d 100644 --- a/crates/ui-egui/src/dialogs/layer_options.rs +++ b/crates/ui-egui/src/dialogs/layer_options.rs @@ -96,11 +96,7 @@ pub fn open_new(app: &mut VectorcraftApp, p: &Value) -> Result { let sublayer = p.get("sublayer").and_then(Value::as_bool).unwrap_or(false); let color = LayerColor::Preset((layers.len() % LAYER_COLORS.len()) as u8); let name = format!("Layer {i}"); - let name = if app.session.prefs.identify_objects_by == "xmlId" { - vectorcraft_doc::xml_id::from_object_name(&name) - } else { - name - }; + let name = if app.session.prefs.identify_objects_by == "xmlId" { vectorcraft_doc::xml_id::from_object_name(&name) } else { name }; let fields = json!({ "mode": if sublayer { "newSublayer" } else { "new" }, "layer": true, "name": name, "color": color_field(color), "template": false, "locked": false, "visible": true, "printable": true, "preview": true, "dimImages": false, "dimPercent": 50, diff --git a/crates/ui-egui/src/panels/layers.rs b/crates/ui-egui/src/panels/layers.rs index 2e933331..bd0ed0f5 100644 --- a/crates/ui-egui/src/panels/layers.rs +++ b/crates/ui-egui/src/panels/layers.rs @@ -691,11 +691,7 @@ fn row(ui: &mut Ui, view: &View, item: &Row, out: &mut Out) { }); // Name (Preferences › Units › Identify Objects By: Object Name or XML ID). let xml_id = view.identify_xml_id; - let name = if doc.mask_edit.is_some_and(|m| m.layer == n.id) { - "".to_string() - } else { - n.identify_label(xml_id) - }; + let name = if doc.mask_edit.is_some_and(|m| m.layer == n.id) { "".to_string() } else { n.identify_label(xml_id) }; let font = egui::FontId::proportional(13.0); let renaming: Option<(u64, String)> = ui.data(|d| d.get_temp(rename_id())); let name_rect = egui::Rect::from_min_max(egui::pos2(x - 2.0, r.center().y - 10.0), egui::pos2(r.right() - 44.0, r.center().y + 10.0));