Skip to content

fix(deps): update rust crate usvg to 0.42 #6193

fix(deps): update rust crate usvg to 0.42

fix(deps): update rust crate usvg to 0.42 #6193

GitHub Actions / clippy failed Jul 11, 2024 in 0s

clippy

2 errors, 26 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 2
Warning 26
Note 0
Help 0

Versions

  • rustc 1.79.0 (129f3b996 2024-06-10)
  • cargo 1.79.0 (ffa9cf99a 2024-06-03)
  • clippy 0.1.79 (129f3b9 2024-06-10)

Annotations

Check failure on line 13 in crates/components/vector/src/svg_parser.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

mismatched types

error[E0308]: mismatched types
    --> crates/components/vector/src/svg_parser.rs:13:45
     |
13   |     vello_svg::render_tree_with(&mut scene, &svg_tree, &usvg::Transform::default(), &mut vello_svg::default_error_handler)?;
     |     ---------------------------             ^^^^^^^^^ expected `vello_svg::usvg::Tree`, found `usvg::Tree`
     |     |
     |     arguments to this function are incorrect
     |
     = note: `usvg::Tree` and `vello_svg::usvg::Tree` have similar names, but are actually distinct types
note: `usvg::Tree` is defined in crate `usvg`
    --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/usvg-0.42.0/src/tree/mod.rs:1539:1
     |
1539 | pub struct Tree {
     | ^^^^^^^^^^^^^^^
note: `vello_svg::usvg::Tree` is defined in crate `usvg`
    --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/usvg-0.40.0/src/tree/mod.rs:1506:1
     |
1506 | pub struct Tree {
     | ^^^^^^^^^^^^^^^
     = note: perhaps two different versions of crate `usvg` are being used?
note: function defined here
    --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/vello_svg-0.1.0/src/lib.rs:71:8
     |
71   | pub fn render_tree_with<F: FnMut(&mut Scene, &usvg::Node) -> Result<(), E>, E>(
     |        ^^^^^^^^^^^^^^^^

Check failure on line 11 in crates/components/vector/src/svg_parser.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function takes 2 arguments but 3 arguments were supplied

error[E0061]: this function takes 2 arguments but 3 arguments were supplied
  --> crates/components/vector/src/svg_parser.rs:11:20
   |
11 |     let svg_tree = usvg::Tree::from_data(svg, &usvg::Options::default(), &fontdb)?;
   |                    ^^^^^^^^^^^^^^^^^^^^^                               ---------
   |                                                                        | |
   |                                                                        | unexpected argument of type `&usvg::fontdb::Database`
   |                                                                        help: remove the extra argument
   |
note: associated function defined here
  --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/usvg-0.42.0/src/parser/mod.rs:98:12
   |
98 |     pub fn from_data(data: &[u8], opt: &Options) -> Result<Self, Error> {
   |            ^^^^^^^^^

Check warning on line 26 in crates/components/timecode/src/commands/rename_timecode_control.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

assigning the result of `Clone::clone()` may be inefficient

warning: assigning the result of `Clone::clone()` may be inefficient
  --> crates/components/timecode/src/commands/rename_timecode_control.rs:26:13
   |
26 |             control.name = self.name.clone();
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `control.name.clone_from(&self.name)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones

Check warning on line 17 in crates/components/ui/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you should consider adding a `Default` implementation for `UiApi`

warning: you should consider adding a `Default` implementation for `UiApi`
  --> crates/components/ui/src/lib.rs:13:5
   |
13 | /     pub fn new() -> Self {
14 | |         Self {
15 | |             bus: MessageBus::new(),
16 | |         }
17 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
   = note: `#[warn(clippy::new_without_default)]` on by default
help: try adding this
   |
12 + impl Default for UiApi {
13 +     fn default() -> Self {
14 +         Self::new()
15 +     }
16 + }
   |

Check warning on line 26 in crates/components/timecode/src/commands/rename_timecode.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

assigning the result of `Clone::clone()` may be inefficient

warning: assigning the result of `Clone::clone()` may be inefficient
  --> crates/components/timecode/src/commands/rename_timecode.rs:26:13
   |
26 |             timecode.name = self.name.clone();
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `timecode.name.clone_from(&self.name)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
   = note: `#[warn(clippy::assigning_clones)]` on by default

Check warning on line 171 in crates/components/media/src/media_handlers/video_handler.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> crates/components/media/src/media_handlers/video_handler.rs:171:20
    |
171 |         image.save(&target)?;
    |                    ^^^^^^^ help: change this to: `target`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
    = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default

Check warning on line 99 in crates/components/media/src/media_handlers/audio_handler.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you seem to be trying to use `&Box<T>`. Consider using just `&T`

warning: you seem to be trying to use `&Box<T>`. Consider using just `&T`
  --> crates/components/media/src/media_handlers/audio_handler.rs:99:34
   |
99 |     fn get_channel_count(format: &Box<dyn FormatReader>) -> Option<u32> {
   |                                  ^^^^^^^^^^^^^^^^^^^^^^ help: try: `&dyn FormatReader`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box

Check warning on line 93 in crates/components/media/src/media_handlers/audio_handler.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you seem to be trying to use `&Box<T>`. Consider using just `&T`

warning: you seem to be trying to use `&Box<T>`. Consider using just `&T`
  --> crates/components/media/src/media_handlers/audio_handler.rs:93:32
   |
93 |     fn get_sample_rate(format: &Box<dyn FormatReader>) -> Option<u32> {
   |                                ^^^^^^^^^^^^^^^^^^^^^^ help: try: `&dyn FormatReader`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box

Check warning on line 84 in crates/components/media/src/media_handlers/audio_handler.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you seem to be trying to use `&Box<T>`. Consider using just `&T`

warning: you seem to be trying to use `&Box<T>`. Consider using just `&T`
  --> crates/components/media/src/media_handlers/audio_handler.rs:84:29
   |
84 |     fn get_duration(format: &Box<dyn FormatReader>) -> Option<u64> {
   |                             ^^^^^^^^^^^^^^^^^^^^^^ help: try: `&dyn FormatReader`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box
   = note: `#[warn(clippy::borrowed_box)]` on by default

Check warning on line 64 in crates/components/media/src/documents/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you should consider adding a `Default` implementation for `TagId`

warning: you should consider adding a `Default` implementation for `TagId`
  --> crates/components/media/src/documents/mod.rs:62:5
   |
62 | /     pub fn new() -> Self {
63 | |         TagId(uuid::Uuid::new_v4())
64 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try adding this
   |
61 + impl Default for TagId {
62 +     fn default() -> Self {
63 +         Self::new()
64 +     }
65 + }
   |

Check warning on line 25 in crates/components/media/src/documents/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you should consider adding a `Default` implementation for `MediaId`

warning: you should consider adding a `Default` implementation for `MediaId`
  --> crates/components/media/src/documents/mod.rs:23:5
   |
23 | /     pub fn new() -> Self {
24 | |         MediaId(uuid::Uuid::new_v4())
25 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
   = note: `#[warn(clippy::new_without_default)]` on by default
help: try adding this
   |
22 + impl Default for MediaId {
23 +     fn default() -> Self {
24 +         Self::new()
25 +     }
26 + }
   |

Check warning on line 33 in crates/components/connections/protocols/midi/src/connections.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

assigning the result of `Clone::clone()` may be inefficient

warning: assigning the result of `Clone::clone()` may be inefficient
  --> crates/components/connections/protocols/midi/src/connections.rs:33:13
   |
33 |             device.profile = profile.clone();
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `device.profile.clone_from(&profile)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
   = note: `#[warn(clippy::assigning_clones)]` on by default

Check warning on line 46 in crates/components/media/src/media_handlers/video_handler.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

associated function `transcode_command` is never used

warning: associated function `transcode_command` is never used
  --> crates/components/media/src/media_handlers/video_handler.rs:46:8
   |
16 | impl VideoHandler {
   | ----------------- associated function in this implementation
...
46 |     fn transcode_command<I: AsRef<OsStr>, O: AsRef<OsStr>>(
   |        ^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

Check warning on line 62 in crates/components/connections/protocols/midi/device-profiles/src/profile.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

implementation of inherent method `to_string(&self) -> String` for type `profile::ProfileErrors`

warning: implementation of inherent method `to_string(&self) -> String` for type `profile::ProfileErrors`
  --> crates/components/connections/protocols/midi/device-profiles/src/profile.rs:51:5
   |
51 | /     pub fn to_string(&self) -> String {
52 | |         match self {
53 | |             ProfileErrors::PagesLoadingError(err) => format!("Pages loading error: {}", err),
54 | |             ProfileErrors::OutputScriptLoadingError(err) => {
...  |
61 | |         }
62 | |     }
   | |_____^
   |
   = help: implement trait `Display` for type `profile::ProfileErrors` instead
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string
   = note: `#[warn(clippy::inherent_to_string)]` on by default

Check warning on line 48 in crates/components/connections/protocols/midi/device-profiles/src/profile.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

all variants have the same postfix: `Error`

warning: all variants have the same postfix: `Error`
  --> crates/components/connections/protocols/midi/device-profiles/src/profile.rs:43:1
   |
43 | / pub enum ProfileErrors {
44 | |     PagesLoadingError(String),
45 | |     OutputScriptLoadingError(String),
46 | |     OutputScriptWritingError(String),
47 | |     LayoutLoadingError(String),
48 | | }
   | |_^
   |
   = help: remove the postfixes and use full paths to the variants instead of glob imports
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names
   = note: `#[warn(clippy::enum_variant_names)]` on by default

Check warning on line 60 in crates/components/connections/devices/webcams/src/discovery.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you should consider adding a `Default` implementation for `WebcamDiscovery`

warning: you should consider adding a `Default` implementation for `WebcamDiscovery`
  --> crates/components/connections/devices/webcams/src/discovery.rs:46:5
   |
46 | /     pub fn new() -> Self {
47 | |         let (sender, receiver) = unbounded();
48 | |
49 | |         if !nokhwa_check() {
...  |
59 | |         Self { cameras: receiver }
60 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
   = note: `#[warn(clippy::new_without_default)]` on by default
help: try adding this
   |
45 + impl Default for WebcamDiscovery {
46 +     fn default() -> Self {
47 +         Self::new()
48 +     }
49 + }
   |

Check warning on line 91 in crates/components/connections/protocols/pro-dj-link/src/discovery.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this `if let` can be collapsed into the outer `if let`

warning: this `if let` can be collapsed into the outer `if let`
  --> crates/components/connections/protocols/pro-dj-link/src/discovery.rs:85:29
   |
85 | / ...                   if let ProDJLinkDevice::CDJ(cdj) = device {
86 | | ...                       cdj.speed = packet.speed;
87 | | ...                       cdj.beat = packet.beat;
88 | | ...                       if let Err(err) = sender.send(ProDJLinkDevice::CDJ(cdj.clone())) {
89 | | ...                           tracing::error!("Failed to send CDJ device: {err:?}");
90 | | ...                       }
91 | | ...                   }
   | |_______________________^
   |
help: the outer pattern can be modified to include the inner pattern
  --> crates/components/connections/protocols/pro-dj-link/src/discovery.rs:84:37
   |
84 |                         if let Some(device) = devices.get_mut(&packet.device_id) {
   |                                     ^^^^^^ replace this binding
85 |                             if let ProDJLinkDevice::CDJ(cdj) = device {
   |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match
   = note: `#[warn(clippy::collapsible_match)]` on by default

Check warning on line 29 in crates/components/connections/protocols/dmx/src/commands/add_artnet_input.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `Ipv4Addr` which implements the `Copy` trait

warning: using `clone` on type `Ipv4Addr` which implements the `Copy` trait
  --> crates/components/connections/protocols/dmx/src/commands/add_artnet_input.rs:29:38
   |
29 |         let input = ArtnetInput::new(self.host.clone(), self.port, self.name.clone())?;
   |                                      ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.host`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

Check warning on line 29 in crates/components/connections/protocols/dmx/src/buffer.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `[u8; 512]` which implements the `Copy` trait

warning: using `clone` on type `[u8; 512]` which implements the `Copy` trait
  --> crates/components/connections/protocols/dmx/src/buffer.rs:29:56
   |
29 |         self.buffers.iter().map(|entry| (*entry.key(), entry.value().clone()))
   |                                                        ^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*entry.value()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
   = note: `#[warn(clippy::clone_on_copy)]` on by default

Check warning on line 80 in crates/components/connections/protocols/dmx/src/inputs/artnet.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

field `thread` is never read

warning: field `thread` is never read
  --> crates/components/connections/protocols/dmx/src/inputs/artnet.rs:80:5
   |
79 | struct ThreadHandle {
   |        ------------ field in this struct
80 |     thread: JoinHandle<()>,
   |     ^^^^^^
   |
   = note: `ThreadHandle` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
   = note: `#[warn(dead_code)]` on by default

Check warning on line 85 in crates/runtime/wgpu/src/context.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

returning the result of a `let` binding from a block

warning: returning the result of a `let` binding from a block
  --> crates/runtime/wgpu/src/context.rs:85:9
   |
74 | /         let texture = self.device.create_texture(&wgpu::TextureDescriptor {
75 | |             label,
76 | |             size,
77 | |             mip_level_count: 1,
...  |
82 | |             view_formats: &[format],
83 | |         });
   | |___________- unnecessary `let` binding
84 |
85 |           texture
   |           ^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
   = note: `#[warn(clippy::let_and_return)]` on by default
help: return the expression directly
   |
74 ~         
75 | 
76 ~         self.device.create_texture(&wgpu::TextureDescriptor {
77 +             label,
78 +             size,
79 +             mip_level_count: 1,
80 +             sample_count: 1,
81 +             dimension: wgpu::TextureDimension::D2,
82 +             format,
83 +             usage,
84 +             view_formats: &[format],
85 +         })
   |

Check warning on line 11 in crates/runtime/commander/src/extractors/sub_command.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

very complex type used. Consider factoring parts into `type` definitions

warning: very complex type used. Consider factoring parts into `type` definitions
  --> crates/runtime/commander/src/extractors/sub_command.rs:11:39
   |
11 |     pub fn apply(self, command: T) -> anyhow::Result<(T::Result, (T, T::State))> {
   |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
   = note: `#[warn(clippy::type_complexity)]` on by default

Check warning on line 143 in crates/runtime/commander/src/extractors/tuples.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded unit expression

warning: unneeded unit expression
   --> crates/runtime/commander/src/extractors/tuples.rs:143:9
    |
143 |         ()
    |         ^^ help: remove the final `()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit
    = note: `#[warn(clippy::unused_unit)]` on by default

Check warning on line 8 in crates/util/src/conversion.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

clamp-like pattern without using clamp function

warning: clamp-like pattern without using clamp function
 --> crates/util/src/conversion.rs:8:9
  |
8 |         (self * u8::MAX as f64).min(255.).max(0.).floor() as u8
  |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(self * u8::MAX as f64).clamp(0., 255.)`
  |
  = note: clamp will panic if max < min, min.is_nan(), or max.is_nan()
  = note: clamp returns NaN if the input is NaN
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp
  = note: `#[warn(clippy::manual_clamp)]` on by default

Check warning on line 97 in crates/runtime/module/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

bound is defined in more than one place

warning: bound is defined in more than one place
  --> crates/runtime/module/src/lib.rs:97:24
   |
97 |     fn block_in_thread<A: 'static, F: Future + 'static>(&self, future_action: A)
   |                        ^
98 |     where
99 |         A: FnOnce() -> F + Send;
   |         ^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_bound_locations
   = note: `#[warn(clippy::multiple_bound_locations)]` on by default