mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
clippy: fix warnings in components/shared (#31565)
* clippy: fix some warnings in components/shared * fix: unit tests * fix: review comments
This commit is contained in:
parent
3a5ca785d3
commit
43f44965cd
14 changed files with 102 additions and 139 deletions
|
@ -39,6 +39,7 @@ pub enum WebrenderImageHandlerType {
|
|||
/// List of Webrender external images to be shared among all external image
|
||||
/// consumers (WebGL, Media, WebGPU).
|
||||
/// It ensures that external image identifiers are unique.
|
||||
#[derive(Default)]
|
||||
pub struct WebrenderExternalImageRegistry {
|
||||
/// Map of all generated external images.
|
||||
external_images: HashMap<ExternalImageId, WebrenderImageHandlerType>,
|
||||
|
@ -47,13 +48,6 @@ pub struct WebrenderExternalImageRegistry {
|
|||
}
|
||||
|
||||
impl WebrenderExternalImageRegistry {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
external_images: HashMap::new(),
|
||||
next_image_id: 0,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn next_id(&mut self, handler_type: WebrenderImageHandlerType) -> ExternalImageId {
|
||||
self.next_image_id += 1;
|
||||
let key = ExternalImageId(self.next_image_id);
|
||||
|
@ -84,7 +78,7 @@ pub struct WebrenderExternalImageHandlers {
|
|||
|
||||
impl WebrenderExternalImageHandlers {
|
||||
pub fn new() -> (Self, Arc<Mutex<WebrenderExternalImageRegistry>>) {
|
||||
let external_images = Arc::new(Mutex::new(WebrenderExternalImageRegistry::new()));
|
||||
let external_images = Arc::new(Mutex::new(WebrenderExternalImageRegistry::default()));
|
||||
(
|
||||
Self {
|
||||
webgl_handler: None,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue