Use closures for QRCode::style

This commit is contained in:
Héctor Ramón Jiménez 2024-03-12 14:51:30 +01:00
parent afd138dba6
commit 6741630218
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
2 changed files with 16 additions and 14 deletions

View file

@ -391,9 +391,11 @@ where
/// [`QRCode`]: crate::QRCode
/// [`Data`]: crate::qr_code::Data
#[cfg(feature = "qr_code")]
pub fn qr_code<Theme>(data: &crate::qr_code::Data) -> crate::QRCode<'_, Theme>
pub fn qr_code<'a, Theme>(
data: &'a crate::qr_code::Data,
) -> crate::QRCode<'a, Theme>
where
Theme: crate::qr_code::DefaultStyle,
Theme: crate::qr_code::DefaultStyle + 'a,
{
crate::QRCode::new(data)
}