Skip to content

Commit d32d1e3

Browse files
committed
Add From impls
1 parent 2ac1251 commit d32d1e3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/lib.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ impl Script {
2222
}
2323
}
2424

25+
impl From<char> for Script {
26+
fn from(o: char) -> Self {
27+
o.script()
28+
}
29+
}
30+
2531
impl ScriptExtension {
2632
/// Obtain the list of scripts contained inside this ScriptExtension
2733
#[cfg(feature = "with_std")]
@@ -46,6 +52,12 @@ impl ScriptExtension {
4652
}
4753
}
4854

55+
impl From<char> for ScriptExtension {
56+
fn from(o: char) -> Self {
57+
o.script_extension()
58+
}
59+
}
60+
4961
/// Extension trait on `char` for calculating script properties
5062
pub trait UnicodeScript {
5163
/// Get the script for a given character

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy