forked from 1b-agent/opencadstudio-upstream
style: apply cargo fmt across workspace
This commit is contained in:
1 parent
85710e5454
commit
9cf9ff2c5c
531 files changed
+57740
-33906
No files matched your search
+22
-11
@@ -84,12 +84,7 @@ impl Default for AutoConstrainSettings {
|
||||
impl AutoConstrainSettings {
|
||||
pub fn sanitize(&mut self) {
|
||||
let mut priority = Vec::with_capacity(AutoConstraintKind::ALL.len());
|
||||
for kind in self
|
||||
.priority
|
||||
.iter()
|
||||
.copied()
|
||||
.chain(AutoConstraintKind::ALL)
|
||||
{
|
||||
for kind in self.priority.iter().copied().chain(AutoConstraintKind::ALL) {
|
||||
if !priority.contains(&kind) {
|
||||
priority.push(kind);
|
||||
}
|
||||
@@ -571,7 +566,10 @@ pub struct UserSettings {
|
||||
pub language: crate::i18n::Language,
|
||||
/// CLIPROMPTLINES: how many temporary prompt lines for a single command
|
||||
/// are displayed above the command window (0–50, Registry, default 3).
|
||||
#[serde(default = "default_clipromptlines", deserialize_with = "deserialize_clipromptlines")]
|
||||
#[serde(
|
||||
default = "default_clipromptlines",
|
||||
deserialize_with = "deserialize_clipromptlines"
|
||||
)]
|
||||
pub cliprompt_lines: i32,
|
||||
/// COMMANDLINEFADETIME: how long command-line overlay history lines stay
|
||||
/// visible, in milliseconds (0–60000, default 3000). 0 skips transient lines.
|
||||
@@ -967,7 +965,10 @@ mod tests {
|
||||
SnapType::Center,
|
||||
SnapType::Intersection,
|
||||
] {
|
||||
assert!(modes.contains(&expected), "{expected:?} is not in the default set");
|
||||
assert!(
|
||||
modes.contains(&expected),
|
||||
"{expected:?} is not in the default set"
|
||||
);
|
||||
}
|
||||
|
||||
// The Snapper and the persisted default have to agree, or the running
|
||||
@@ -978,12 +979,19 @@ mod tests {
|
||||
#[test]
|
||||
fn osmode_encodes_bits_and_suppress() {
|
||||
// Endpoint(1) + Midpoint(2) + Intersection(32) = 35, master on.
|
||||
let on = [SnapType::Endpoint, SnapType::Midpoint, SnapType::Intersection];
|
||||
let on = [
|
||||
SnapType::Endpoint,
|
||||
SnapType::Midpoint,
|
||||
SnapType::Intersection,
|
||||
];
|
||||
assert_eq!(osmode_from_snaps(on.iter(), true), 35);
|
||||
// Master off sets the suppress bit (16384).
|
||||
assert_eq!(osmode_from_snaps(on.iter(), false), 35 | 16384);
|
||||
// OCS-only snaps carry no bit and are dropped.
|
||||
assert_eq!(osmode_from_snaps([SnapType::Grid, SnapType::ObjectPick].iter(), true), 0);
|
||||
assert_eq!(
|
||||
osmode_from_snaps([SnapType::Grid, SnapType::ObjectPick].iter(), true),
|
||||
0
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -1035,7 +1043,10 @@ mod tests {
|
||||
fn script_commands_default_on_and_survive_a_round_trip() {
|
||||
let missing: crate::app::config::AppConfig =
|
||||
serde_json::from_str(r#"{"settings": {"pick_add": false}}"#).unwrap();
|
||||
assert!(missing.settings.script_commands, "an old config keeps scripts allowed");
|
||||
assert!(
|
||||
missing.settings.script_commands,
|
||||
"an old config keeps scripts allowed"
|
||||
);
|
||||
let off: crate::app::config::AppConfig =
|
||||
serde_json::from_str(r#"{"settings": {"script_commands": false}}"#).unwrap();
|
||||
assert!(!off.settings.script_commands);
|
||||
|
||||
Reference in new issue
Block a user