mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Move convert_label to Into implementation (#33348)
Signed-off-by: Taym <haddadi.taym@gmail.com>
This commit is contained in:
parent
bc04f94a30
commit
152e62022a
11 changed files with 23 additions and 31 deletions
|
@ -497,14 +497,15 @@ impl TryFrom<&GPUImageCopyTexture> for wgpu_com::ImageCopyTexture {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn convert_label<'a>(parent: &GPUObjectDescriptorBase) -> Option<Cow<'a, str>> {
|
||||
if parent.label.is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(Cow::Owned(parent.label.to_string()))
|
||||
impl<'a> Into<Option<Cow<'a, str>>> for &GPUObjectDescriptorBase {
|
||||
fn into(self) -> Option<Cow<'a, str>> {
|
||||
if self.label.is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(Cow::Owned(self.label.to_string()))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn convert_bind_group_layout_entry(
|
||||
bgle: &GPUBindGroupLayoutEntry,
|
||||
device: &GPUDevice,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue