mirror of
https://github.com/wez/wezterm.git
synced 2024-11-28 01:06:37 +03:00
more dyn courtesy of cargo +nightly fix
This commit is contained in:
parent
b43c207167
commit
0a1dd49409
@ -48,7 +48,7 @@ impl FontSystem for CoreTextSystem {
|
||||
config: &Config,
|
||||
style: &TextStyle,
|
||||
font_scale: f64,
|
||||
) -> Result<Box<NamedFont>, Error> {
|
||||
) -> Result<Box<dyn NamedFont>, Error> {
|
||||
let mut fonts = Vec::new();
|
||||
for font_attr in style.font_with_fallback() {
|
||||
let col = match create_for_family(&font_attr.family) {
|
||||
@ -80,11 +80,11 @@ impl FontSystem for CoreTextSystem {
|
||||
}
|
||||
|
||||
impl NamedFont for NamedFontImpl {
|
||||
fn get_fallback(&mut self, idx: FallbackIdx) -> Result<&Font, Error> {
|
||||
fn get_fallback(&mut self, idx: FallbackIdx) -> Result<&dyn Font, Error> {
|
||||
self.fonts
|
||||
.get(idx)
|
||||
.map(|f| {
|
||||
let f: &Font = f;
|
||||
let f: &dyn Font = f;
|
||||
f
|
||||
})
|
||||
.ok_or_else(|| format_err!("no fallback fonts available (idx={})", idx))
|
||||
|
@ -36,7 +36,7 @@ impl FontSystem for FontLoaderAndFreeType {
|
||||
config: &Config,
|
||||
style: &TextStyle,
|
||||
font_scale: f64,
|
||||
) -> Result<Box<NamedFont>, Error> {
|
||||
) -> Result<Box<dyn NamedFont>, Error> {
|
||||
let mut lib = ftwrap::Library::new()?;
|
||||
// Some systems don't support this mode, so if it fails, we don't
|
||||
// care to abort the rest of what we're doing
|
||||
@ -70,11 +70,11 @@ impl FontSystem for FontLoaderAndFreeType {
|
||||
}
|
||||
|
||||
impl NamedFont for NamedFontImpl {
|
||||
fn get_fallback(&mut self, idx: FallbackIdx) -> Result<&Font, Error> {
|
||||
fn get_fallback(&mut self, idx: FallbackIdx) -> Result<&dyn Font, Error> {
|
||||
self.fonts
|
||||
.get(idx)
|
||||
.map(|f| {
|
||||
let f: &Font = f;
|
||||
let f: &dyn Font = f;
|
||||
f
|
||||
})
|
||||
.ok_or_else(|| format_err!("no fallback fonts available (idx={})", idx))
|
||||
|
Loading…
Reference in New Issue
Block a user