Граф коммитов

2 Коммитов

Автор SHA1 Сообщение Дата
Paul Adenot ef5f58b382
Run `cargo fmt` and make scripts executable (#62)
* Make scripts executable

* cargo fmt
2020-03-24 07:58:20 -07:00
Chun-Min Chang 132d2093f7
Clean up clippy warnings and errors (#49)
* Set RUST_BACKTRACE in the environment

* Add Rust format check in Travis CI

* Add Rust clippy check in Travis CI

* Fix warning: array_into_iter

Replace `.into_iter()` by `.iter()` used in the Rust array

* Fix warning: private_in_public

Allow private struct AudioUnitStream in public interface when running tests

* Fix clippy errors in audio_unit_get_property_info

* Fix clippy errors in audio_unit_render

* Align interface of audio_unit_get_property with audio_unit_get_property_info

- Change `data` and `size` of audio_unit_get_property from raw pointers
to references
- Make the variable `size` used when calling audio_unit_get_property in
test_audiounit_scope_is_enabled live when the calling explicitly

* Align interface of audio_unit_set_property with audio_unit_get_property's one

* Fix clippy warning: redundant_field_names in create_device_info

* Fix clippy warning: let_and_return in create_blank_device

* Fix clippy warning: let_and_return in audiounit_input_callback

* Fix clippy warning: needless_return in host_time_to_ns

* Fix clippy warning: or_fun_call in get_device_label

The function within `or(...)` will always be called and potentially
allocate an object acting as the default. We don't need to call
get_device_name if get_device_source_name works

* Fix clippy warning: len_zero in Mixer::new

* Fix clippy warning: option_map_unit_fn in Finalizer::drop

* Fix clippy error: float_cmp in minimum_resampling_input_frames

* Fix clippy warning: needless_range_loop in audiounit_output_callback

* Allow clippy::mutex_atomic on set_buffer_size_sync

* Fix clippy warning: redundant_clone in get_range_of_sample_rates

* Fix clippy warning: cmp_null in DevicesData::is_empty

* Fix clippy warning: unnecessary_unwrap in reinit

* Fix clippy warning: or_fun_call in current_device

* Allow clippy::cognitive_complexity on CoreStreamData::setup

* Allow clippy::cast_ptr_alignment on get_device_stream_configuration

* Fix clippy warning: needless_range_loop in get_default_channel_order

* Fix clippy warning: missing_safety_doc for audiounit_rust_init

* Avoid using set_len in allocate_array

`set_len` is unsafe function that should be avoided if possible. On the
other hand, we should initialize the item value when allocating the
array by expected size or the number of the items.

* Fix warning: unused_parens in stream_init

* Fix warning: unused_parens in CoreStreamData::setup

* Skip test changing the default device if no device is available

* Automatically install latest clippy and rustfmt

- Download and install the latest available rustfmt if rustfmt isn't
available in the nightly
- Install latest available clippy if clippy in nightly isn't available
2020-02-18 14:09:56 -08:00