1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-20 11:17:15 +03:00

maybe fixup windows build for num/num_traits changes

This commit is contained in:
Wez Furlong 2020-06-13 12:05:47 -07:00
parent b373f0d774
commit 39f4985741
4 changed files with 7 additions and 7 deletions

2
Cargo.lock generated
View File

@ -3794,7 +3794,7 @@ dependencies = [
"bitflags 1.2.1",
"image",
"log",
"num",
"num-traits 0.2.12",
"ordered-float",
"palette",
"pretty_assertions",

View File

@ -18,7 +18,7 @@ bitflags = "1.0"
anyhow = "1.0"
image = "0.23"
log = "0.4"
num = "0.2"
num-traits = "0.2"
ordered-float = "1.0"
palette = "0.5"
unicode-segmentation = "1.6"

View File

@ -6,6 +6,7 @@ use crate::color::{ColorPalette, RgbColor};
use anyhow::bail;
use image::{self, GenericImageView};
use log::{debug, error};
use num_traits::FromPrimitive;
use ordered_float::NotNan;
use std::collections::HashMap;
use std::fmt::Write;
@ -2222,7 +2223,7 @@ impl<'a> Performer<'a> {
use termwiz::escape::osc::DynamicColorNumber;
let mut idx: u8 = first_color as u8;
for color in colors {
let which_color: Option<DynamicColorNumber> = num::FromPrimitive::from_u8(idx);
let which_color: Option<DynamicColorNumber> = FromPrimitive::from_u8(idx);
log::trace!("ChangeDynamicColors item: {:?}", which_color);
if let Some(which_color) = which_color {
macro_rules! set_or_query {
@ -2264,8 +2265,7 @@ impl<'a> Performer<'a> {
OperatingSystemCommand::ResetDynamicColor(color) => {
log::trace!("ResetDynamicColor: {:?}", color);
use termwiz::escape::osc::DynamicColorNumber;
let which_color: Option<DynamicColorNumber> =
num::FromPrimitive::from_u8(color as u8);
let which_color: Option<DynamicColorNumber> = FromPrimitive::from_u8(color as u8);
if let Some(which_color) = which_color {
macro_rules! reset {
($name:ident) => {

View File

@ -5,7 +5,7 @@ use crate::cell::{AttributeChange, CellAttributes, Underline};
use crate::color::{AnsiColor, ColorAttribute};
use crate::surface::{Change, Position};
use crate::terminal::windows::ConsoleOutputHandle;
use num;
use num_traits::FromPrimitive;
use std::io::Write;
use winapi::shared::minwindef::WORD;
use winapi::um::wincon::{
@ -31,7 +31,7 @@ fn to_attr_word(attr: &CellAttributes) -> u16 {
($idx:expr, $default:ident,
$red:ident, $green:ident, $blue:ident,
$bright:ident, $( ($variant:ident, $bits:expr) ),*) =>{
match num::FromPrimitive::from_u8($idx).unwrap_or(AnsiColor::$default) {
match FromPrimitive::from_u8($idx).unwrap_or(AnsiColor::$default) {
$(
AnsiColor::$variant => $bits,
)*