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
+14
-40
@@ -6,8 +6,8 @@
|
||||
//! entity geometry continues through the normal render pipeline.
|
||||
|
||||
use codec::objects::{
|
||||
AssociativeData, BlockEvalValue, DynamicBlockData, ObjectType,
|
||||
SolidHistoryNodeBase, SolidHistoryOperation,
|
||||
AssociativeData, BlockEvalValue, DynamicBlockData, ObjectType, SolidHistoryNodeBase,
|
||||
SolidHistoryOperation,
|
||||
};
|
||||
use codec::{CadDocument, EntityType, Handle};
|
||||
|
||||
@@ -107,11 +107,7 @@ pub fn render_settings(cache: &ObjectDataCache) -> &[Handle] {
|
||||
&cache.render_settings
|
||||
}
|
||||
|
||||
pub fn update_light_entity(
|
||||
cache: &mut ObjectDataCache,
|
||||
handle: Handle,
|
||||
exists: bool,
|
||||
) {
|
||||
pub fn update_light_entity(cache: &mut ObjectDataCache, handle: Handle, exists: bool) {
|
||||
let lights = std::sync::Arc::make_mut(&mut cache.light_entities);
|
||||
if exists {
|
||||
if !lights.contains(&handle) {
|
||||
@@ -361,8 +357,7 @@ fn solid_history_sections(
|
||||
let Some(history_handle) = entity_history_handle(entity) else {
|
||||
return Vec::new();
|
||||
};
|
||||
let Some(ObjectType::DynamicBlock(history_object)) =
|
||||
document.objects.get(&history_handle)
|
||||
let Some(ObjectType::DynamicBlock(history_object)) = document.objects.get(&history_handle)
|
||||
else {
|
||||
return vec![PropSection {
|
||||
title: "Solid History".to_string(),
|
||||
@@ -771,8 +766,7 @@ fn dynamic_block_sections(
|
||||
.filter(|object| {
|
||||
!matches!(
|
||||
object.data,
|
||||
DynamicBlockData::SolidHistory(_)
|
||||
| DynamicBlockData::SolidHistoryNode(_)
|
||||
DynamicBlockData::SolidHistory(_) | DynamicBlockData::SolidHistoryNode(_)
|
||||
)
|
||||
})
|
||||
.map(|object| {
|
||||
@@ -1028,9 +1022,7 @@ where
|
||||
result
|
||||
}
|
||||
|
||||
fn class_object_section(
|
||||
data: &codec::objects::ClassObjectData,
|
||||
) -> Option<PropSection> {
|
||||
fn class_object_section(data: &codec::objects::ClassObjectData) -> Option<PropSection> {
|
||||
use codec::objects::ClassObjectData;
|
||||
|
||||
let section = match data {
|
||||
@@ -2058,9 +2050,7 @@ fn class_object_section(
|
||||
Some(section)
|
||||
}
|
||||
|
||||
fn semantic_property_text(
|
||||
value: &codec::objects::SemanticPropertyValue,
|
||||
) -> String {
|
||||
fn semantic_property_text(value: &codec::objects::SemanticPropertyValue) -> String {
|
||||
use codec::objects::SemanticPropertyValue;
|
||||
match value {
|
||||
SemanticPropertyValue::Text(value) => preview_text(value, 512),
|
||||
@@ -2075,9 +2065,7 @@ fn semantic_property_text(
|
||||
}
|
||||
}
|
||||
|
||||
fn auxiliary_object_property(
|
||||
object: &ObjectType,
|
||||
) -> Option<Property> {
|
||||
fn auxiliary_object_property(object: &ObjectType) -> Option<Property> {
|
||||
use codec::objects::DataObjectData;
|
||||
|
||||
let (label, value) = match object {
|
||||
@@ -2275,9 +2263,7 @@ fn build_document_sections(document: &CadDocument) -> Vec<PropSection> {
|
||||
"Design Point",
|
||||
format!(
|
||||
"{:.8}, {:.8}, {:.8}",
|
||||
value.design_point.x,
|
||||
value.design_point.y,
|
||||
value.design_point.z
|
||||
value.design_point.x, value.design_point.y, value.design_point.z
|
||||
),
|
||||
),
|
||||
ro(
|
||||
@@ -2300,9 +2286,7 @@ fn build_document_sections(document: &CadDocument) -> Vec<PropSection> {
|
||||
"Up",
|
||||
format!(
|
||||
"{:.8}, {:.8}, {:.8}",
|
||||
value.up_direction.x,
|
||||
value.up_direction.y,
|
||||
value.up_direction.z
|
||||
value.up_direction.x, value.up_direction.y, value.up_direction.z
|
||||
),
|
||||
),
|
||||
ro(
|
||||
@@ -2380,11 +2364,7 @@ fn build_document_sections(document: &CadDocument) -> Vec<PropSection> {
|
||||
"Entries",
|
||||
bounded_join(
|
||||
list.lights.iter().map(|light| {
|
||||
format!(
|
||||
"{}={}",
|
||||
light.name,
|
||||
handle_text(light.handle)
|
||||
)
|
||||
format!("{}={}", light.name, handle_text(light.handle))
|
||||
}),
|
||||
64,
|
||||
),
|
||||
@@ -2404,9 +2384,7 @@ fn build_document_sections(document: &CadDocument) -> Vec<PropSection> {
|
||||
"Date / Time",
|
||||
format!(
|
||||
"Julian {}; {} ms; DST {}",
|
||||
sun.julian_day,
|
||||
sun.milliseconds,
|
||||
sun.is_daylight_savings_on
|
||||
sun.julian_day, sun.milliseconds, sun.is_daylight_savings_on
|
||||
),
|
||||
),
|
||||
ro(
|
||||
@@ -2651,8 +2629,7 @@ fn build_document_sections(document: &CadDocument) -> Vec<PropSection> {
|
||||
"Display",
|
||||
format!(
|
||||
"predefined first {}; high-level info {}",
|
||||
global.predefined_presets_first,
|
||||
global.high_level_info
|
||||
global.predefined_presets_first, global.high_level_info
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -2669,10 +2646,7 @@ fn build_document_sections(document: &CadDocument) -> Vec<PropSection> {
|
||||
}
|
||||
|
||||
if !document.dgn_ls_definitions.is_empty() {
|
||||
let mut definitions = document
|
||||
.dgn_ls_definitions
|
||||
.values()
|
||||
.collect::<Vec<_>>();
|
||||
let mut definitions = document.dgn_ls_definitions.values().collect::<Vec<_>>();
|
||||
definitions.sort_by_key(|definition| definition.handle.value());
|
||||
let omitted = definitions.len().saturating_sub(128);
|
||||
let mut props = definitions
|
||||
|
||||
Reference in new issue
Block a user