From 2fd75447ec7cfc4ce771cf1226661d96eccae5b8 Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Wed, 6 Nov 2024 04:42:23 -0700 Subject: [PATCH 1/2] fix: relax header string parsing --- src/header/builder.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/header/builder.rs b/src/header/builder.rs index eb865bf2..851b6467 100644 --- a/src/header/builder.rs +++ b/src/header/builder.rs @@ -117,19 +117,14 @@ impl Builder { generating_software: raw_header .generating_software .as_ref() - .as_las_str()? - .to_string(), + .as_las_string_lossy(), gps_time_type: raw_header.global_encoding.into(), guid: Uuid::from_bytes(raw_header.guid), has_synthetic_return_numbers: raw_header.global_encoding & 8 == 8, has_wkt_crs: raw_header.global_encoding & 16 == 16, padding: raw_header.padding, point_format, - system_identifier: raw_header - .system_identifier - .as_ref() - .as_las_str()? - .to_string(), + system_identifier: raw_header.system_identifier.as_ref().as_las_string_lossy(), transforms: Vector { x: Transform { scale: raw_header.x_scale_factor, From 5ded1b880cd84d24133db62b632c807436f4f26c Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Wed, 6 Nov 2024 04:45:05 -0700 Subject: [PATCH 2/2] chore: update rustfmt.toml --- rustfmt.toml | 128 +++++++++++++++++++++++++-------------------------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/rustfmt.toml b/rustfmt.toml index f4ce2a7e..8994abc7 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,78 +1,78 @@ -max_width = 100 -hard_tabs = false -tab_spaces = 4 -newline_style = "Auto" -indent_style = "Block" -use_small_heuristics = "Default" -fn_call_width = 60 -attr_fn_like_width = 70 -struct_lit_width = 18 -struct_variant_width = 35 array_width = 60 +attr_fn_like_width = 70 +binop_separator = "Front" +blank_lines_lower_bound = 0 +blank_lines_upper_bound = 1 +brace_style = "SameLineWhere" chain_width = 60 -single_line_if_else_max_width = 50 -single_line_let_else_max_width = 50 -wrap_comments = false -format_code_in_doc_comments = false -doc_comment_code_block_width = 100 +color = "Auto" +combine_control_expr = true comment_width = 80 -normalize_comments = false -normalize_doc_attributes = false -format_strings = false -format_macro_matchers = false -format_macro_bodies = true -skip_macro_invocations = [] -hex_literal_case = "Preserve" +condense_wildcard_suffixes = false +control_brace_style = "AlwaysSameLine" +disable_all_formatting = false +doc_comment_code_block_width = 100 +edition = "2021" +emit_mode = "Files" empty_item_single_line = true -struct_lit_single_line = true +enum_discrim_align_threshold = 0 +error_on_line_overflow = false +error_on_unformatted = false +fn_call_width = 60 +fn_params_layout = "Tall" fn_single_line = false -where_single_line = false +force_explicit_abi = true +force_multiline_blocks = false +format_code_in_doc_comments = false +format_generated_files = true +format_macro_bodies = true +format_macro_matchers = false +format_strings = false +group_imports = "One" +hard_tabs = false +hex_literal_case = "Preserve" +ignore = [] +imports_granularity = "Crate" imports_indent = "Block" imports_layout = "Mixed" -imports_granularity = "Crate" -group_imports = "One" +indent_style = "Block" +inline_attribute_width = 0 +make_backup = false +match_arm_blocks = true +match_arm_leading_pipes = "Never" +match_block_trailing_comma = false +max_width = 100 +merge_derives = true +newline_style = "Auto" +normalize_comments = false +normalize_doc_attributes = false +overflow_delimited_expr = false +remove_nested_parens = true +reorder_impl_items = false reorder_imports = true reorder_modules = true -reorder_impl_items = false -type_punctuation_density = "Wide" -space_before_colon = false +required_version = "1.8.0" +short_array_element_width_threshold = 10 +show_parse_errors = true +single_line_if_else_max_width = 50 +single_line_let_else_max_width = 50 +skip_children = false +skip_macro_invocations = [] space_after_colon = true +space_before_colon = false spaces_around_ranges = false -binop_separator = "Front" -remove_nested_parens = true -combine_control_expr = true -short_array_element_width_threshold = 10 -overflow_delimited_expr = false struct_field_align_threshold = 0 -enum_discrim_align_threshold = 0 -match_arm_blocks = true -match_arm_leading_pipes = "Never" -force_multiline_blocks = false -fn_params_layout = "Tall" -brace_style = "SameLineWhere" -control_brace_style = "AlwaysSameLine" -trailing_semicolon = true +struct_lit_single_line = true +struct_lit_width = 18 +struct_variant_width = 35 +style_edition = "2021" +tab_spaces = 4 trailing_comma = "Vertical" -match_block_trailing_comma = false -blank_lines_upper_bound = 1 -blank_lines_lower_bound = 0 -edition = "2015" -version = "One" -inline_attribute_width = 0 -format_generated_files = true -merge_derives = true -use_try_shorthand = false -use_field_init_shorthand = false -force_explicit_abi = true -condense_wildcard_suffixes = false -color = "Auto" -required_version = "1.7.1" +trailing_semicolon = true +type_punctuation_density = "Wide" unstable_features = false -disable_all_formatting = false -skip_children = false -show_parse_errors = true -error_on_line_overflow = false -error_on_unformatted = false -ignore = [] -emit_mode = "Files" -make_backup = false +use_field_init_shorthand = false +use_small_heuristics = "Default" +use_try_shorthand = false +where_single_line = false +wrap_comments = false