From ecda11ebd52dd9477430b95f99050fb881d25109 Mon Sep 17 00:00:00 2001 From: Gijs Burghoorn Date: Wed, 10 May 2023 20:11:45 +0200 Subject: [PATCH 01/26] Some clean ups, fixes, config flag (#91) * Refactor: Remove unneccesary CLI branching * Refactor: Refactor configuration load function * Feat: Add '--config' flag * Refactor: Reduce passing of args and configuration * Fix: Fix cli parsing of page width * Clean: use 'display()' instead of debug print for path * Clean: use Default for Keybindings * Refactor: Use Keybindings in tests * Doc: Fix 'page width' to 'page_width' * Refactor: use interpolation style * Refactor: Remove inline on Keybindings::new * Refactor: Extract Keybindings Default implementation * Refactor: Destructure Config and Args in opts --- src/keybindings/defaults.rs | 4 +- src/keybindings/mod.rs | 33 ++++++++++- src/keybindings/tests.rs | 3 +- src/main.rs | 52 +++++++++-------- src/opts/cli.rs | 62 ++++++++------------ src/opts/config.rs | 33 ++++++++--- src/opts/mod.rs | 113 ++++++++++++++++++++++-------------- src/opts/tests.rs | 24 +++----- 8 files changed, 191 insertions(+), 133 deletions(-) diff --git a/src/keybindings/defaults.rs b/src/keybindings/defaults.rs index 9993bfcb..0a212ab8 100644 --- a/src/keybindings/defaults.rs +++ b/src/keybindings/defaults.rs @@ -1,10 +1,10 @@ -use super::{Action, Key, KeyCombo, Keybindings, ModifiedKey}; +use super::{Action, Key, KeyCombo, ModifiedKey}; use winit::event::{ModifiersState, VirtualKeyCode as VirtKey}; const IS_MACOS: bool = cfg!(target_os = "macos"); -pub fn defaults() -> Keybindings { +pub fn defaults() -> Vec<(Action, KeyCombo)> { let ctrl_or_command = if IS_MACOS { ModifiersState::LOGO } else { diff --git a/src/keybindings/mod.rs b/src/keybindings/mod.rs index 8577f55a..9f3474eb 100644 --- a/src/keybindings/mod.rs +++ b/src/keybindings/mod.rs @@ -4,14 +4,13 @@ mod serialization; #[cfg(test)] mod tests; -pub use defaults::defaults; - use std::{collections::BTreeMap, fmt, slice::Iter, str::FromStr, vec::IntoIter}; use serde::Deserialize; use winit::event::{ModifiersState, ScanCode, VirtualKeyCode}; -pub type Keybindings = Vec<(Action, KeyCombo)>; +#[derive(Debug, Clone, Deserialize, PartialEq, Eq)] +pub struct Keybindings(Vec<(Action, KeyCombo)>); #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)] pub enum Key { @@ -19,6 +18,33 @@ pub enum Key { ScanCode(ScanCode), } +impl Keybindings { + pub fn new(bindings: Vec<(Action, KeyCombo)>) -> Self { + Self(bindings) + } +} + +impl Extend<(Action, KeyCombo)> for Keybindings { + fn extend>(&mut self, iter: I) { + self.0.extend(iter) + } +} + +impl IntoIterator for Keybindings { + type Item = (Action, KeyCombo); + type IntoIter = as IntoIterator>::IntoIter; + + fn into_iter(self) -> Self::IntoIter { + self.0.into_iter() + } +} + +impl Default for Keybindings { + fn default() -> Self { + Self(defaults::defaults()) + } +} + impl Key { pub fn new(resolved: Option, scan_code: ScanCode) -> Self { match resolved { @@ -170,6 +196,7 @@ pub struct KeyCombos { impl KeyCombos { pub fn new(keybinds: Keybindings) -> anyhow::Result { + let keybinds = keybinds.0; let position = ROOT_INDEX; // A keycombo that starts with another keycombo will never be reachable since the prefixing diff --git a/src/keybindings/tests.rs b/src/keybindings/tests.rs index 5fb5e169..9f6db94d 100644 --- a/src/keybindings/tests.rs +++ b/src/keybindings/tests.rs @@ -1,4 +1,4 @@ -use super::{Action, Key, KeyCombo, KeyCombos, ModifiedKey}; +use super::{Action, Key, KeyCombo, KeyCombos, ModifiedKey, Keybindings}; use serde::Deserialize; use winit::event::{ModifiersState, VirtualKeyCode}; @@ -25,6 +25,7 @@ inner = [ let cap_g = ModifiedKey(Key::from(VirtualKeyCode::G), ModifiersState::SHIFT); let j = ModifiedKey::from(VirtualKeyCode::J); + let bindings = Keybindings::new(bindings); let mut key_combos = KeyCombos::new(bindings).unwrap(); // Invalid combo 'gG' where the key that broke us out is a singlekey combo diff --git a/src/main.rs b/src/main.rs index 286b67ef..43c1f3f4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -122,6 +122,7 @@ impl From for Element { } pub struct Inlyne { + opts: Opts, window: Arc, event_loop: EventLoop, renderer: Renderer, @@ -129,7 +130,6 @@ pub struct Inlyne { clipboard: ClipboardContext, elements: Vec>, lines_to_scroll: f32, - args: Args, image_cache: ImageCache, interpreter_sender: mpsc::Sender, interpreter_should_queue: Arc, @@ -181,7 +181,7 @@ impl Inlyne { // Add the file path to be watched. let event_proxy = self.event_loop.create_proxy(); - let file_path = self.args.file_path.clone(); + let file_path = self.opts.file_path.clone(); std::thread::spawn(move || { watcher .watch(&file_path, RecursiveMode::NonRecursive) @@ -204,12 +204,12 @@ impl Inlyne { }); } - pub fn new(opts: &Opts, args: Args) -> anyhow::Result { + pub fn new(opts: Opts) -> anyhow::Result { let keycombos = KeyCombos::new(opts.keybindings.clone())?; let event_loop = EventLoopBuilder::::with_user_event().build(); let window = Arc::new(Window::new(&event_loop).unwrap()); - match root_filepath_to_vcs_dir(&args.file_path) { + match root_filepath_to_vcs_dir(&opts.file_path) { Some(path) => window.set_title(&format!("Inlyne - {}", path.to_string_lossy())), None => window.set_title("Inlyne"), } @@ -225,7 +225,7 @@ impl Inlyne { let element_queue = Arc::new(Mutex::new(VecDeque::new())); let image_cache = Arc::new(Mutex::new(HashMap::new())); let md_string = read_to_string(&opts.file_path) - .with_context(|| format!("Could not read file at {:?}", opts.file_path))?; + .with_context(|| format!("Could not read file at '{}'", opts.file_path.display()))?; let interpreter = HtmlInterpreter::new( window.clone(), @@ -233,7 +233,7 @@ impl Inlyne { renderer.theme.clone(), renderer.surface_format, renderer.hidpi_scale, - args.file_path.clone(), + opts.file_path.clone(), image_cache.clone(), event_loop.create_proxy(), ); @@ -244,15 +244,17 @@ impl Inlyne { interpreter_sender.send(md_string)?; + let lines_to_scroll = opts.lines_to_scroll; + Ok(Self { + opts, window, event_loop, renderer, element_queue, clipboard, elements: Vec::new(), - lines_to_scroll: opts.lines_to_scroll, - args, + lines_to_scroll, interpreter_sender, interpreter_should_queue, image_cache, @@ -287,9 +289,12 @@ impl Inlyne { self.renderer.positioner.reserved_height = DEFAULT_PADDING * self.renderer.hidpi_scale; self.renderer.positioner.anchors.clear(); - let md_string = read_to_string(&self.args.file_path) + let md_string = read_to_string(&self.opts.file_path) .with_context(|| { - format!("Could not read file at {:?}", self.args.file_path) + format!( + "Could not read file at '{}'", + self.opts.file_path.display() + ) }) .unwrap(); self.interpreter_should_queue.store(true, Ordering::Relaxed); @@ -470,15 +475,17 @@ impl Inlyne { }); if is_local_md { // Open markdown files ourselves - let mut args = self.args.clone(); let path = maybe_path.expect("not a path"); // Handle relative paths and make them // absolute by prepending current // parent let path = if path.is_relative() { // Simply canonicalizing it doesn't suffice and leads to "no such file or directory" - let current_parent = - args.file_path.parent().expect("no current parent"); + let current_parent = self + .opts + .file_path + .parent() + .expect("no current parent"); let link_without_prefix: &Path = path .strip_prefix(std::path::Component::CurDir) .expect("no CurDir prefix"); @@ -490,16 +497,15 @@ impl Inlyne { }; // Open them in a new window, akin to what a browser does if modifiers.shift() { - args.file_path = path; Command::new( std::env::current_exe() .unwrap_or_else(|_| "inlyne".into()), ) - .args(args.program_args()) + .args(Opts::program_args(&path)) .spawn() .expect("Could not spawn new inlyne instance"); } else { - self.args.file_path = path; + self.opts.file_path = path; event_loop_proxy .send_event(InlyneEvent::FileReload) .expect("new file to reload successfully"); @@ -710,19 +716,19 @@ fn main() -> anyhow::Result<()> { .parse_env("INLYNE_LOG") .init(); - let config = match Config::load() { - Ok(config) => config, - Err(err) => { + let args = Args::new(); + let config = match &args.config { + Some(config_path) => Config::load_from_file(config_path)?, + None => Config::load_from_system().unwrap_or_else(|err| { log::warn!( "Failed reading config file. Falling back to defaults. Error: {}", err ); Config::default() - } + }), }; - let args = Args::new(&config); - let opts = Opts::parse_and_load_from(&args, config); - let inlyne = Inlyne::new(&opts, args)?; + let opts = Opts::parse_and_load_from(args, config); + let inlyne = Inlyne::new(opts)?; inlyne.spawn_watcher(); inlyne.run(); diff --git a/src/opts/cli.rs b/src/opts/cli.rs index f69050db..56c3e58d 100644 --- a/src/opts/cli.rs +++ b/src/opts/cli.rs @@ -1,13 +1,16 @@ use std::{env, ffi::OsString, io, path::PathBuf}; -use super::{config::Config, ThemeType}; +use super::ThemeType; use clap::builder::PossibleValue; use clap::{command, value_parser, Arg, Command, ValueEnum, ValueHint}; use clap_complete::{generate, Generator, Shell}; +const SCALE_HELP: &str = + "Factor to scale rendered file by [default: OS defined window scale factor]"; + impl ThemeType { - fn as_str(&self) -> &'static str { + pub fn as_str(&self) -> &'static str { match self { Self::Auto => "auto", Self::Dark => "dark", @@ -31,10 +34,11 @@ pub struct Args { pub file_path: PathBuf, pub theme: Option, pub scale: Option, + pub config: Option, pub page_width: Option, } -pub fn command(scale_help: String, default_theme: Option) -> Command { +pub fn command() -> Command { let file_arg = Arg::new("file") .required_unless_present("shell") .number_of_values(1) @@ -43,22 +47,19 @@ pub fn command(scale_help: String, default_theme: Option) -> Command .value_hint(ValueHint::AnyPath) .help("Path to the markdown file"); - let mut theme_arg = Arg::new("theme") + let theme_arg = Arg::new("theme") .short('t') .long("theme") .number_of_values(1) .value_parser(value_parser!(ThemeType)) .help("Theme to use when rendering"); - if let Some(theme) = default_theme { - theme_arg = theme_arg.default_value(theme.as_str()); - } let scale_arg = Arg::new("scale") .short('s') .long("scale") .number_of_values(1) .value_parser(value_parser!(f32)) - .help(scale_help); + .help(SCALE_HELP); let gen_comp_arg = Arg::new("shell") .long("gen-completions") @@ -66,6 +67,13 @@ pub fn command(scale_help: String, default_theme: Option) -> Command .number_of_values(1) .value_parser(value_parser!(Shell)); + let config_arg = Arg::new("config") + .short('c') + .long("config") + .number_of_values(1) + .value_parser(value_parser!(PathBuf)) + .help("Configuration file to use"); + let page_width_arg = Arg::new("page_width") .short('w') .long("page-width") @@ -78,47 +86,23 @@ pub fn command(scale_help: String, default_theme: Option) -> Command .arg(theme_arg) .arg(scale_arg) .arg(gen_comp_arg) + .arg(config_arg) .arg(page_width_arg) } impl Args { - const SCALE_HELP: &str = "Factor to scale rendered file by"; - - pub fn new(config: &Config) -> Self { + pub fn new() -> Self { let program_args = std::env::args_os().collect(); - Self::parse_from(program_args, config) - } - - pub fn program_args(&self) -> Vec { - let mut args = Vec::new(); - args.push(self.file_path.as_os_str().to_str().unwrap().to_string()); - if let Some(theme) = self.theme { - args.push("--theme".to_owned()); - args.push(theme.as_str().to_owned()); - } - if let Some(scale) = self.scale { - args.push("--scale".to_owned()); - args.push(scale.to_string()); - } - args + Self::parse_from(program_args) } - pub fn parse_from(args: Vec, config: &Config) -> Self { - let scale_help = format!( - "{} [default: {}]", - Self::SCALE_HELP, - match config.scale { - Some(scale) => scale.to_string(), - None => String::from("Window's scale factor"), - } - ); - - let c = command(scale_help, config.theme); + pub fn parse_from(args: Vec) -> Self { + let c = command(); let matches = c.get_matches_from(args); // Shell completions exit early so handle them first if let Some(shell) = matches.get_one::("shell").copied() { - let mut c = command(Self::SCALE_HELP.to_owned(), None); + let mut c = command(); Self::print_completions(shell, &mut c); std::process::exit(0); } @@ -126,12 +110,14 @@ impl Args { let file_path = matches.get_one("file").cloned().expect("required"); let theme = matches.get_one("theme").cloned(); let scale = matches.get_one("scale").cloned(); + let config = matches.get_one("config").cloned(); let page_width = matches.get_one("page_width").cloned(); Self { file_path, theme, scale, + config, page_width, } } diff --git a/src/opts/config.rs b/src/opts/config.rs index 5539a312..5842a832 100644 --- a/src/opts/config.rs +++ b/src/opts/config.rs @@ -1,4 +1,5 @@ use std::fs::read_to_string; +use std::path::Path; use super::ThemeType; use crate::{color, keybindings::Keybindings}; @@ -57,6 +58,12 @@ impl OptionalTheme { #[derive(Deserialize, Debug)] pub struct LinesToScroll(pub f32); +impl From for f32 { + fn from(value: LinesToScroll) -> Self { + value.0 + } +} + impl Default for LinesToScroll { fn default() -> Self { Self(3.0) @@ -83,15 +90,25 @@ pub struct Config { } impl Config { - pub fn load() -> anyhow::Result { - let config_dir = dirs::config_dir().context("Failed detecting config dir")?; + pub fn load_from_file(path: &Path) -> anyhow::Result { + let config_content = read_to_string(path).context(format!( + "Failed to read configuration file at '{}'", + path.display() + ))?; + + Ok(toml::from_str(&config_content)?) + } + + pub fn load_from_system() -> anyhow::Result { + let config_dir = + dirs::config_dir().context("Failed to find the configuration directory")?; + let config_path = config_dir.join("inlyne").join("inlyne.toml"); - if config_path.is_file() { - let text = read_to_string(&config_path).context("Failed reading config file")?; - let config = toml::from_str(&text)?; - Ok(config) - } else { - Ok(Self::default()) + + if !config_path.is_file() { + return Ok(Self::default()); } + + Self::load_from_file(&config_path) } } diff --git a/src/opts/mod.rs b/src/opts/mod.rs index fd17412d..6cad7c3f 100644 --- a/src/opts/mod.rs +++ b/src/opts/mod.rs @@ -3,12 +3,9 @@ mod config; #[cfg(test)] mod tests; -use std::path::PathBuf; +use std::path::{Path, PathBuf}; -use crate::{ - color, - keybindings::{self, Keybindings}, -}; +use crate::{color, keybindings::Keybindings}; use serde::Deserialize; @@ -63,7 +60,7 @@ pub struct Opts { } impl Opts { - pub fn parse_and_load_from(args: &Args, config: Config) -> Self { + pub fn parse_and_load_from(args: Args, config: Config) -> Self { #[cfg(test)] { // "Use" the unused params @@ -76,63 +73,93 @@ impl Opts { #[cfg(test)] pub fn parse_and_load_with_system_theme( - args: &Args, + args: Args, config: Config, theme: ResolvedTheme, ) -> Self { Self::parse_and_load_inner(args, config, theme) } - fn parse_and_load_inner(args: &Args, config: Config, fallback_theme: ResolvedTheme) -> Self { + fn parse_and_load_inner(args: Args, config: Config, fallback_theme: ResolvedTheme) -> Self { let Config { theme: config_theme, scale: config_scale, page_width: config_page_width, - lines_to_scroll: config_lines_to_scroll, - light_theme: config_light_theme, - dark_theme: config_dark_theme, - font_options: config_font_options, - keybindings: - config::KeybindingsSection { - base: keybindings_base, - extra: keybindings_extra, - }, + lines_to_scroll, + light_theme, + dark_theme, + font_options, + keybindings: config_keybindings, } = config; - let resolved_theme = args - .theme + let Args { + file_path, + theme: args_theme, + scale: args_scale, + config: _, + page_width: args_page_width, + } = args; + + let file_path = file_path; + let resolved_theme = args_theme .or(config_theme) - .map(ResolvedTheme::from) - .unwrap_or(fallback_theme); + .map_or(fallback_theme, ResolvedTheme::from); let theme = match resolved_theme { - ResolvedTheme::Dark => match config_dark_theme { - Some(config_dark_theme) => config_dark_theme.merge(color::DARK_DEFAULT), - None => color::DARK_DEFAULT, - }, - ResolvedTheme::Light => match config_light_theme { - Some(config_light_theme) => config_light_theme.merge(color::LIGHT_DEFAULT), - None => color::LIGHT_DEFAULT, - }, - }; - - let font_opts = config_font_options.unwrap_or_default(); - - let keybindings = { - let mut temp = keybindings_base.unwrap_or_else(keybindings::defaults); - if let Some(extra) = keybindings_extra { - temp.extend(extra.into_iter()); - } - temp + ResolvedTheme::Dark => dark_theme.map_or(color::DARK_DEFAULT, |dark_theme| { + dark_theme.merge(color::DARK_DEFAULT) + }), + ResolvedTheme::Light => light_theme + .map_or(color::LIGHT_DEFAULT, |light_theme| { + light_theme.merge(color::LIGHT_DEFAULT) + }), }; + let scale = args_scale.or(config_scale); + let font_opts = font_options.unwrap_or_default(); + let page_width = args_page_width.or(config_page_width); + let lines_to_scroll = lines_to_scroll.into(); + let mut keybindings = config_keybindings.base.unwrap_or_default(); + if let Some(extra) = config_keybindings.extra { + keybindings.extend(extra.into_iter()); + } Self { - file_path: args.file_path.clone(), + file_path, theme, - scale: args.scale.or(config_scale), - page_width: args.page_width.or(config_page_width), - lines_to_scroll: config_lines_to_scroll.0, + scale, + page_width, + lines_to_scroll, font_opts, keybindings, } } + + /// Arguments to supply to program that are opened externally. + pub fn program_args(file_path: &Path) -> Vec { + let current_args = Args::new(); + let mut args = Vec::new(); + + args.push(file_path.display().to_string()); + + if let Some(theme) = current_args.theme { + args.push("--theme".to_owned()); + args.push(theme.as_str().to_owned()); + } + + if let Some(scale) = current_args.scale { + args.push("--scale".to_owned()); + args.push(scale.to_string()); + } + + if let Some(config) = current_args.config { + args.push("--config".to_owned()); + args.push(config.display().to_string()); + } + + if let Some(page_width) = current_args.page_width { + args.push("-w".to_owned()); + args.push(page_width.to_string()); + } + + args + } } diff --git a/src/opts/tests.rs b/src/opts/tests.rs index 13e90248..b9fbf066 100644 --- a/src/opts/tests.rs +++ b/src/opts/tests.rs @@ -2,7 +2,7 @@ use std::{ffi::OsString, path::PathBuf}; use super::{cli, config, Opts, ResolvedTheme, ThemeType}; use crate::color::{self, Theme}; -use crate::keybindings; +use crate::keybindings::Keybindings; use crate::opts::config::{FontOptions, LinesToScroll}; use crate::opts::Args; @@ -24,7 +24,7 @@ impl Opts { page_width: None, font_opts: FontOptions::default(), lines_to_scroll: LinesToScroll::default().0, - keybindings: keybindings::defaults(), + keybindings: Keybindings::default(), } } } @@ -40,19 +40,14 @@ impl ResolvedTheme { #[test] fn debug_assert() { - cli::command( - "Factor to scale rendered file by [default: Window's scale factor]".to_string(), - None, - ) - .debug_assert(); + cli::command().debug_assert(); } #[test] fn defaults() { - let config = config::Config::default(); assert_eq!( Opts::parse_and_load_with_system_theme( - &Args::parse_from(gen_args(vec!["file.md"]), &config), + Args::parse_from(gen_args(vec!["file.md"])), config::Config::default(), ResolvedTheme::Light, ), @@ -69,7 +64,7 @@ fn config_overrides_default() { }; assert_eq!( Opts::parse_and_load_with_system_theme( - &Args::parse_from(gen_args(vec!["file.md"]), &config), + Args::parse_from(gen_args(vec!["file.md"])), config, ResolvedTheme::Light, ), @@ -86,7 +81,7 @@ fn config_overrides_default() { }; assert_eq!( Opts::parse_and_load_with_system_theme( - &Args::parse_from(gen_args(vec!["file.md"]), &config), + Args::parse_from(gen_args(vec!["file.md"])), config, ResolvedTheme::Dark, ), @@ -102,7 +97,7 @@ fn config_overrides_default() { }; assert_eq!( Opts::parse_and_load_with_system_theme( - &Args::parse_from(gen_args(vec!["file.md"]), &config), + Args::parse_from(gen_args(vec!["file.md"])), config, ResolvedTheme::Light, ), @@ -115,10 +110,9 @@ fn config_overrides_default() { #[test] fn from_cli() { - let config = config::Config::default(); assert_eq!( Opts::parse_and_load_with_system_theme( - &Args::parse_from(gen_args(vec!["--theme", "dark", "file.md"]), &config), + Args::parse_from(gen_args(vec!["--theme", "dark", "file.md"])), config::Config::default(), ResolvedTheme::Light, ), @@ -136,7 +130,7 @@ fn from_cli() { }; assert_eq!( Opts::parse_and_load_with_system_theme( - &Args::parse_from(gen_args(vec!["--scale", "1.5", "file.md"]), &config), + Args::parse_from(gen_args(vec!["--scale", "1.5", "file.md"])), config, ResolvedTheme::Light, ), From dc5535d49e3f930193609a22829407ab987703ea Mon Sep 17 00:00:00 2001 From: CosmicHorror Date: Wed, 10 May 2023 20:44:45 -0600 Subject: [PATCH 02/26] Support bare relative links (#103) --- src/main.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 43c1f3f4..14be728d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -486,11 +486,14 @@ impl Inlyne { .file_path .parent() .expect("no current parent"); - let link_without_prefix: &Path = path + let mut normalized_link = path.as_path(); + if let Ok(stripped) = normalized_link .strip_prefix(std::path::Component::CurDir) - .expect("no CurDir prefix"); + { + normalized_link = stripped; + } let mut link = current_parent.to_path_buf(); - link.push(link_without_prefix); + link.push(normalized_link); link } else { path From c101a7ac038c3eefee5139060706673ae28e06d8 Mon Sep 17 00:00:00 2001 From: CosmicHorror Date: Sun, 14 May 2023 13:32:06 -0600 Subject: [PATCH 03/26] Attempt to reregister file watcher on file "removal" (#106) --- src/main.rs | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 14be728d..c7367ec0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -56,6 +56,7 @@ use std::sync::mpsc; use std::sync::mpsc::channel; use std::sync::Arc; use std::sync::Mutex; +use std::time::Duration; pub enum InlyneEvent { LoadedImage(String, Arc>>), @@ -189,16 +190,32 @@ impl Inlyne { loop { let event = match watch_rx.recv() { - Ok(event) => event, + Ok(Ok(event)) => event, + Ok(Err(err)) => { + log::warn!("File watcher error: {}", err); + continue; + } Err(err) => { - log::warn!("Config watcher channel dropped unexpectedly: {}", err); + log::warn!("File watcher channel dropped unexpectedly: {}", err); break; } }; - if event.unwrap().kind.is_modify() { - // Always reload the primary configuration file. + log::debug!("File event: {:#?}", event); + if event.kind.is_modify() { let _ = event_proxy.send_event(InlyneEvent::FileReload); + } else if event.kind.is_remove() { + // Some editors may remove/rename the file as a part of saving. + // Reregister file watching in this case + std::thread::sleep(Duration::from_millis(10)); + log::info!( + "File may have been renamed/removed. Attempting to re-register file watcher" + ); + + let _ = watcher.unwatch(&file_path); + if let Err(err) = watcher.watch(&file_path, RecursiveMode::NonRecursive) { + log::warn!("Unable to watch file. No longer reloading: {}", err); + } } } }); From 9b67377eae3bee37fb9aaee3a0b10c880bbffcbc Mon Sep 17 00:00:00 2001 From: CosmicHorror Date: Sun, 14 May 2023 20:17:04 -0600 Subject: [PATCH 04/26] Add a test for all CLI options (#116) --- src/opts/tests.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/opts/tests.rs b/src/opts/tests.rs index b9fbf066..6a90de36 100644 --- a/src/opts/tests.rs +++ b/src/opts/tests.rs @@ -141,3 +141,28 @@ fn from_cli() { } ); } + +#[test] +fn cli_kitchen_sink() { + #[rustfmt::skip] + let args = gen_args(vec![ + "--theme", "dark", + "--scale", "1.5", + "--config", "/path/to/file.toml", + "--page-width", "500", + "file.md", + ]); + assert_eq!( + Opts::parse_and_load_with_system_theme( + Args::parse_from(args), + config::Config::default(), + ResolvedTheme::Light, + ), + Opts { + page_width: Some(500.0), + scale: Some(1.5), + theme: ResolvedTheme::Dark.as_theme(), + ..Opts::mostly_default("file.md") + } + ); +} From 915d4032a6a5df19d5872485c68dc7aa398cdaa6 Mon Sep 17 00:00:00 2001 From: CosmicHorror Date: Wed, 17 May 2023 13:44:39 -0600 Subject: [PATCH 05/26] Add repology badge for package manager installation (#109) --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index e659bc68..3e84cc81 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,9 @@ view markdown files in the blink of an eye. ## Install To install just use `cargo install inlyne`, everything comes pre-bundled. +Alternatively you can install through various package managers. + +[![Packaging status](https://repology.org/badge/vertical-allrepos/inlyne.svg)](https://repology.org/project/inlyne/versions) ## Features From c3c2e076f3e4891ce1ab7242dbc6a016c16bd03b Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Sat, 20 May 2023 18:59:57 +0100 Subject: [PATCH 06/26] Make correct location of `inlyne.toml` file clearer (#122) * Make correct location of `inlyne.toml` file clearer * Fix missing backtick --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3e84cc81..124e18e6 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,13 @@ You weren't supposed to see this! ## Configuration -Use `inlyne --help` to see all the command line options. Some of which can be set permentantly by placing an `inlyne.toml` file into the default [dirs](https://crates.io/crates/dirs) configuration folder for your respective OS. Checkout `inlyne.toml.sample` for an example configuration. +Use `inlyne --help` to see all the command line options. Some of which can be set permentantly by placing an `inlyne.toml` file into a directory called `inlyne` within the default [dirs](https://crates.io/crates/dirs) configuration folder for your respective OS: + +- Linux: `/home/alice/.config/inlyne/inlyne.toml` +- Windows: `C:\Users\Alice\AppData\Roaming\inlyne\inlyne.toml` +- Mac: `/Users/Alice/Library/Application Support/inlyne/inlyne.toml` + +Checkout `inlyne.toml.sample` for an example configuration. ## FAQ From 66985d1ac65c3d907a95ac74e37a95035714d1fd Mon Sep 17 00:00:00 2001 From: CosmicHorror Date: Wed, 31 May 2023 12:11:35 -0600 Subject: [PATCH 07/26] Interpreter testing (#132) --- Cargo.lock | 38 ++++ Cargo.toml | 1 + src/debug_impls.rs | 203 ++++++++++++++++++ src/image/mod.rs | 9 +- src/interpreter/html.rs | 65 ++++++ src/{interpreter.rs => interpreter/mod.rs} | 142 ++++++------ .../inlyne__interpreter__tests__sanity.snap | 39 ++++ src/interpreter/tests.rs | 126 +++++++++++ src/main.rs | 1 + src/positioner.rs | 10 +- src/text.rs | 49 ++++- 11 files changed, 597 insertions(+), 86 deletions(-) create mode 100644 src/debug_impls.rs create mode 100644 src/interpreter/html.rs rename src/{interpreter.rs => interpreter/mod.rs} (94%) create mode 100644 src/interpreter/snapshots/inlyne__interpreter__tests__sanity.snap create mode 100644 src/interpreter/tests.rs diff --git a/Cargo.lock b/Cargo.lock index 2153b1ad..df94bcce 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -581,6 +581,18 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "console" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "windows-sys 0.45.0", +] + [[package]] name = "const-cstr" version = "0.3.0" @@ -927,6 +939,12 @@ version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + [[package]] name = "encoding_rs" version = "0.8.32" @@ -1687,6 +1705,7 @@ dependencies = [ "font-kit", "html5ever", "image", + "insta", "log", "lyon", "lz4_flex", @@ -1726,6 +1745,19 @@ dependencies = [ "libc", ] +[[package]] +name = "insta" +version = "1.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d64600be34b2fcfc267740a243fa7744441bb4947a619ac4e5bb6507f35fbfc" +dependencies = [ + "console", + "lazy_static", + "linked-hash-map", + "similar", + "yaml-rust", +] + [[package]] name = "instant" version = "0.1.12" @@ -3302,6 +3334,12 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "238abfbb77c1915110ad968465608b68e869e0772622c9656714e73e5a1a522f" +[[package]] +name = "similar" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2aeaf503862c419d66959f5d7ca015337d864e9c49485d771b732e2a20453597" + [[package]] name = "simplecss" version = "0.2.1" diff --git a/Cargo.toml b/Cargo.toml index 889cde2d..8be4e277 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -51,4 +51,5 @@ strip = true lto = true [dev-dependencies] +insta = "1.34.0" pretty_assertions = "1.3.0" diff --git a/src/debug_impls.rs b/src/debug_impls.rs new file mode 100644 index 00000000..0157a9aa --- /dev/null +++ b/src/debug_impls.rs @@ -0,0 +1,203 @@ +//! A whole load of custom debug impls to keep the output more succinct +//! +//! Mostly to reduce noise for snapshot tests, but also good in general + +use std::fmt; + +use crate::{ + positioner::Spacer, + text::{Text, TextBox}, +}; + +pub struct DebugF32Color(pub [f32; 4]); + +impl fmt::Debug for DebugF32Color { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + if self.0 == [0.0, 0.0, 0.0, 1.0] { + f.write_str("Color(BLACK)") + } else { + let Self([r, g, b, a]) = self; + + if *a == 1.0 { + f.write_fmt(format_args!("Color {{ r: {r:.2}, g: {g:.2}, b: {b:.2} }}")) + } else { + f.write_fmt(format_args!( + "Color {{ r: {r:.2}, g: {g:.2}, b: {b:.2}, a: {a:.2} }}" + )) + } + } + } +} + +pub struct DebugInlineOption<'inner, T>(pub &'inner Option); + +impl<'inner, T: fmt::Debug> fmt::Debug for DebugInlineOption<'inner, T> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + if let Some(t) = &self.0 { + f.write_fmt(format_args!("Some({t:?})")) + } else { + f.write_str("None") + } + } +} + +pub fn text_box(text_box: &TextBox, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let TextBox { + indent, + texts, + is_code_block, + is_quote_block, + is_checkbox, + is_anchor, + align, + // Globally consistent so avoid displaying as noise + hidpi_scale: _, + padding_height, + background_color, + } = text_box; + + let mut debug = f.debug_struct("TextBox"); + + let default = TextBox::default(); + + if align != &default.align { + debug.field("align", align); + } + if *indent != default.indent { + debug.field("indent", indent); + } + if *padding_height != default.padding_height { + debug.field("padding_height", padding_height); + } + if background_color.is_some() { + let background_color = background_color.map(DebugF32Color); + let debug_background_color = DebugInlineOption(&background_color); + debug.field("background_color", &debug_background_color); + } + if *is_code_block { + debug.field("is_code_block", &true); + } + if is_quote_block.is_some() { + debug.field("is_quote_block", &DebugInlineOption(is_quote_block)); + } + if is_checkbox.is_some() { + debug.field("is_checkbox", &DebugInlineOption(is_checkbox)); + } + if is_anchor.is_some() { + debug.field("is_anchor", &DebugInlineOption(is_anchor)); + } + + // Texts at the end so all the smaller fields for text box are easily visible + debug.field("texts", texts); + + debug.finish() +} + +pub fn text(text: &Text, f: &mut fmt::Formatter<'_>) -> fmt::Result { + #[derive(Copy, Clone)] + struct StyleWrapper { + is_bold: bool, + is_italic: bool, + is_underlined: bool, + is_striked: bool, + } + + impl StyleWrapper { + fn is_regular(self) -> bool { + let Self { + is_bold, + is_italic, + is_underlined, + is_striked, + } = self; + + ![is_bold, is_italic, is_underlined, is_striked].contains(&true) + } + } + + impl fmt::Debug for StyleWrapper { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let Self { + is_bold, + is_italic, + is_underlined, + is_striked, + } = *self; + + if self.is_regular() { + f.write_str("REGULAR")?; + } else { + if is_bold { + f.write_str("BOLD ")?; + } + if is_italic { + f.write_str("ITALIC ")?; + } + if is_underlined { + f.write_str("UNDERLINED ")?; + } + if is_striked { + f.write_str("STRIKED ")?; + } + } + + Ok(()) + } + } + + let Text { + text, + size, + color, + link, + is_bold, + is_italic, + is_underlined, + is_striked, + font: _, + // Globally consistent so avoid displaying as noise + hidpi_scale: _, + default_color, + } = text; + + let mut debug = f.debug_struct("Text"); + + // Fields that we will always display + debug.field("text", text); + + // Fields that we only display when set to unique values + if *size != 16.0 { + debug.field("size", size); + } + if color.is_none() { + debug.field("default_color", &DebugF32Color(*default_color)); + } else { + let color = color.map(DebugF32Color); + let debug_color = DebugInlineOption(&color); + debug.field("color", &debug_color); + } + let style = StyleWrapper { + is_bold: *is_bold, + is_italic: *is_italic, + is_underlined: *is_underlined, + is_striked: *is_striked, + }; + if !style.is_regular() { + debug.field("style", &style); + } + if link.is_some() { + debug.field("link", &DebugInlineOption(link)); + } + + debug.finish() +} + +pub fn spacer(spacer: &Spacer, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let Spacer { space, visible } = spacer; + + if *visible { + f.write_fmt(format_args!("VisibleSpacer({space})")) + } else { + f.write_fmt(format_args!("InvisibleSpacer({space})")) + } +} diff --git a/src/image/mod.rs b/src/image/mod.rs index 49877cd9..4055fbe8 100644 --- a/src/image/mod.rs +++ b/src/image/mod.rs @@ -1,6 +1,6 @@ +use crate::interpreter::ImageCallback; use crate::positioner::DEFAULT_MARGIN; use crate::utils::{usize_in_mib, Align, Point, Size}; -use crate::InlyneEvent; use anyhow::Context; use bytemuck::{Pod, Zeroable}; use image::{ImageBuffer, RgbaImage}; @@ -12,7 +12,6 @@ use std::time::Instant; use usvg::{TreeParsing, TreeTextToPath}; use wgpu::util::DeviceExt; use wgpu::{BindGroup, Device, TextureFormat}; -use winit::event_loop::EventLoopProxy; use std::borrow::Cow; @@ -166,7 +165,7 @@ impl Image { src: String, file_path: PathBuf, hidpi_scale: f32, - event_proxy: EventLoopProxy, + image_callback: Box, ) -> anyhow::Result { let image_data = Arc::new(Mutex::new(None)); let image_data_clone = image_data.clone(); @@ -220,9 +219,7 @@ impl Image { }; *image_data_clone.lock().unwrap() = Some(image); - event_proxy - .send_event(InlyneEvent::LoadedImage(src, image_data_clone)) - .unwrap(); + image_callback.loaded_image(src, image_data_clone); }); let image = Image { diff --git a/src/interpreter/html.rs b/src/interpreter/html.rs new file mode 100644 index 00000000..8861527f --- /dev/null +++ b/src/interpreter/html.rs @@ -0,0 +1,65 @@ +use crate::{positioner::Section, table::Table, text::TextBox, utils::Align}; + +pub enum HeaderType { + H1, + H2, + H3, + H4, + H5, + H6, +} + +impl HeaderType { + pub fn text_size(&self) -> f32 { + match &self { + Self::H1 => 32., + Self::H2 => 24., + Self::H3 => 18.72, + Self::H4 => 16., + Self::H5 => 13.28, + Self::H6 => 10.72, + } + } +} + +pub struct Header { + pub header_type: HeaderType, + pub align: Option, +} + +#[derive(Debug)] +pub enum ListType { + Ordered(usize), + Unordered, +} + +pub struct List { + pub list_type: ListType, +} + +// Represents the number of parent text option tags the current element is a child of +#[derive(Default)] +pub struct TextOptions { + pub underline: usize, + pub bold: usize, + pub italic: usize, + pub strike_through: usize, + pub small: usize, + pub code: usize, + pub pre_formatted: usize, + pub block_quote: usize, + pub link: Vec, +} + +pub enum Element { + List(List), + ListItem, + Input, + Table(Table), + TableRow(Vec), + Header(Header), + Paragraph(Option), + Div(Option), + Details(Section), + Summary, +} diff --git a/src/interpreter.rs b/src/interpreter/mod.rs similarity index 94% rename from src/interpreter.rs rename to src/interpreter/mod.rs index 2f9fb36d..2719467b 100644 --- a/src/interpreter.rs +++ b/src/interpreter/mod.rs @@ -1,5 +1,6 @@ use crate::color::native_color; use crate::image::Image; +use crate::image::ImageData; use crate::image::ImageSize; use crate::positioner::Positioned; use crate::positioner::Row; @@ -37,82 +38,61 @@ use std::sync::mpsc; use std::sync::Arc; use std::sync::Mutex; -mod html { - use crate::{positioner::Section, table::Table, text::TextBox, utils::Align}; +mod html; +#[cfg(test)] +mod tests; - pub enum HeaderType { - H1, - H2, - H3, - H4, - H5, - H6, - } +#[derive(Default)] +struct State { + global_indent: f32, + element_stack: Vec, + text_options: html::TextOptions, + span_color: [f32; 4], + // Stores the row and a counter of newlines after each image + inline_images: Option<(Row, usize)>, +} - impl HeaderType { - pub fn text_size(&self) -> f32 { - match &self { - Self::H1 => 32., - Self::H2 => 24., - Self::H3 => 18.72, - Self::H4 => 16., - Self::H5 => 13.28, - Self::H6 => 10.72, - } - } - } +// Images are loaded in a separate thread and use a callback to indicate when they're finished +pub trait ImageCallback { + fn loaded_image(&self, src: String, image_data: Arc>>); +} - pub struct Header { - pub header_type: HeaderType, - pub align: Option, - } +// External state from the interpreter that we want to stub out for testing +trait WindowInteractor { + fn finished_single_doc(&self); + fn request_redraw(&self); + fn image_callback(&self) -> Box; +} - #[derive(Debug)] - pub enum ListType { - Ordered(usize), - Unordered, - } +struct EventLoopCallback(EventLoopProxy); - pub struct List { - pub list_type: ListType, +impl ImageCallback for EventLoopCallback { + fn loaded_image(&self, src: String, image_data: Arc>>) { + let event = InlyneEvent::LoadedImage(src, image_data); + self.0.send_event(event).unwrap(); } +} - // Represents the number of parent text option tags the current element is a child of - #[derive(Default)] - pub struct TextOptions { - pub underline: usize, - pub bold: usize, - pub italic: usize, - pub strike_through: usize, - pub small: usize, - pub code: usize, - pub pre_formatted: usize, - pub block_quote: usize, - pub link: Vec, +// A real interactive window that is being used with `HtmlInterpreter` +struct LiveWindow { + window: Arc, + event_proxy: EventLoopProxy, +} + +impl WindowInteractor for LiveWindow { + fn request_redraw(&self) { + self.window.request_redraw(); } - pub enum Element { - List(List), - ListItem, - Input, - Table(Table), - TableRow(Vec), - Header(Header), - Paragraph(Option), - Div(Option), - Details(Section), - Summary, + fn image_callback(&self) -> Box { + Box::new(EventLoopCallback(self.event_proxy.clone())) } -} -#[derive(Default)] -struct State { - global_indent: f32, - element_stack: Vec, - text_options: html::TextOptions, - span_color: [f32; 4], - // Stores the row and a counter of newlines after each image - inline_images: Option<(Row, usize)>, + fn finished_single_doc(&self) { + self.event_proxy + .send_event(InlyneEvent::Reposition) + .unwrap(); + } } pub struct HtmlInterpreter { @@ -121,7 +101,6 @@ pub struct HtmlInterpreter { hidpi_scale: f32, theme: Theme, surface_format: TextureFormat, - window: Arc, state: State, file_path: PathBuf, // Whether the interpreters is allowed to queue elements @@ -130,7 +109,7 @@ pub struct HtmlInterpreter { stopped: bool, first_pass: bool, image_cache: ImageCache, - event_proxy: EventLoopProxy, + window: Box, } impl HtmlInterpreter { @@ -143,6 +122,30 @@ impl HtmlInterpreter { file_path: PathBuf, image_cache: ImageCache, event_proxy: EventLoopProxy, + ) -> Self { + let live_window = LiveWindow { + window, + event_proxy, + }; + Self::new_with_interactor( + element_queue, + theme, + surface_format, + hidpi_scale, + file_path, + image_cache, + Box::new(live_window), + ) + } + + fn new_with_interactor( + element_queue: Arc>>, + theme: Theme, + surface_format: TextureFormat, + hidpi_scale: f32, + file_path: PathBuf, + image_cache: ImageCache, + window: Box, ) -> Self { Self { window, @@ -160,7 +163,6 @@ impl HtmlInterpreter { stopped: false, first_pass: true, image_cache, - event_proxy, } } @@ -361,7 +363,7 @@ impl TokenSink for HtmlInterpreter { src.clone(), self.file_path.clone(), self.hidpi_scale, - self.event_proxy.clone(), + self.window.image_callback(), ) .unwrap() .with_align(*align), @@ -837,7 +839,7 @@ impl TokenSink for HtmlInterpreter { self.should_queue .store(false, std::sync::atomic::Ordering::Relaxed); self.first_pass = false; - self.window.request_redraw(); + self.window.finished_single_doc(); } _ => {} } diff --git a/src/interpreter/snapshots/inlyne__interpreter__tests__sanity.snap b/src/interpreter/snapshots/inlyne__interpreter__tests__sanity.snap new file mode 100644 index 00000000..51dc3f8a --- /dev/null +++ b/src/interpreter/snapshots/inlyne__interpreter__tests__sanity.snap @@ -0,0 +1,39 @@ +--- +source: src/interpreter/tests.rs +expression: interpret_md(text) +--- +[ + Spacer( + InvisibleSpacer(5), + ), + TextBox( + TextBox { + is_anchor: Some("#header"), + texts: [ + Text { + text: "Header", + size: 32.0, + default_color: Color(BLACK), + style: BOLD UNDERLINED , + }, + ], + }, + ), + Spacer( + InvisibleSpacer(5), + ), + TextBox( + TextBox { + texts: [ + Text { + text: "Italicized text", + default_color: Color(BLACK), + style: ITALIC , + }, + ], + }, + ), + Spacer( + InvisibleSpacer(5), + ), +] diff --git a/src/interpreter/tests.rs b/src/interpreter/tests.rs new file mode 100644 index 00000000..ff0ddc73 --- /dev/null +++ b/src/interpreter/tests.rs @@ -0,0 +1,126 @@ +use std::{ + collections::VecDeque, + path::PathBuf, + sync::{ + atomic::{AtomicU32, Ordering}, + mpsc, Arc, Mutex, + }, + thread, + time::Duration, +}; + +use super::{HtmlInterpreter, ImageCallback, WindowInteractor}; +use crate::{color::LIGHT_DEFAULT, image::ImageData, Element, ImageCache}; + +use wgpu::TextureFormat; + +// We use a dummy window with an internal counter that keeps track of when rendering a single md +// document is finished +#[derive(Default)] +struct AtomicCounter(Arc); + +impl Clone for AtomicCounter { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } +} + +impl AtomicCounter { + fn new() -> Self { + Self(Arc::new(AtomicU32::from(1))) + } + + fn is_finished(&self) -> bool { + let counter = self.0.load(Ordering::SeqCst); + counter == 0 + } + + fn inc(&self) { + self.0.fetch_add(1, Ordering::SeqCst); + } + + fn dec(&self) { + self.0.fetch_sub(1, Ordering::SeqCst); + } +} + +struct DummyWindow(AtomicCounter); + +impl WindowInteractor for DummyWindow { + fn finished_single_doc(&self) { + self.0.dec(); + } + + fn request_redraw(&self) {} + + // The counter is inc'd for each callback we create and internally dec's when it's called + fn image_callback(&self) -> Box { + self.0.inc(); + Box::new(DummyCallback(self.0.clone())) + } +} + +struct DummyCallback(AtomicCounter); + +impl ImageCallback for DummyCallback { + fn loaded_image(&self, _: String, _: Arc>>) { + self.0.dec(); + } +} + +fn dummy_interpreter(counter: AtomicCounter) -> (HtmlInterpreter, Arc>>) { + let element_queue = Arc::default(); + let theme = LIGHT_DEFAULT; + let surface_format = TextureFormat::Bgra8UnormSrgb; + let hidpi_scale = 1.0; + let file_path = PathBuf::from("does_not_exist"); + let image_cache = ImageCache::default(); + let window = Box::new(DummyWindow(counter)); + let interpreter = HtmlInterpreter::new_with_interactor( + Arc::clone(&element_queue), + theme, + surface_format, + hidpi_scale, + file_path, + image_cache, + window, + ); + + (interpreter, element_queue) +} + +fn interpret_md(text: &str) -> VecDeque { + let counter = AtomicCounter::new(); + let (interpreter, element_queue) = dummy_interpreter(counter.clone()); + let (md_tx, md_rx) = mpsc::channel(); + md_tx.send(text.to_owned()).unwrap(); + let _ = std::thread::spawn(|| { + interpreter.interpret_md(md_rx); + }); + + while !counter.is_finished() { + thread::sleep(Duration::from_millis(1)); + } + + let mut elements_queue = element_queue.lock().unwrap(); + std::mem::take(&mut *elements_queue) +} + +macro_rules! snapshot_interpreted_elements { + ( $( ($test_name:ident, $md_text:ident) ),* $(,)? ) => { + $( + #[test] + fn $test_name() { + let text = $md_text; + ::insta::assert_debug_snapshot!(interpret_md(text)); + } + )* + } +} + +const SANITY: &str = "\ +# Header + +_Italicized text_"; + +snapshot_interpreted_elements!((sanity, SANITY)); diff --git a/src/main.rs b/src/main.rs index c7367ec0..b83ed447 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,5 @@ pub mod color; +mod debug_impls; pub mod fonts; pub mod image; pub mod interpreter; diff --git a/src/positioner.rs b/src/positioner.rs index bacc32dc..9bb0fd23 100644 --- a/src/positioner.rs +++ b/src/positioner.rs @@ -1,9 +1,10 @@ -use std::{cell::RefCell, collections::HashMap}; +use std::{cell::RefCell, collections::HashMap, fmt}; use anyhow::Context; use wgpu_glyph::GlyphBrush; use crate::{ + debug_impls, table::{TABLE_COL_GAP, TABLE_ROW_GAP}, text::TextBox, utils::{Align, Point, Rect, Size}, @@ -246,12 +247,17 @@ impl Positioner { } } -#[derive(Debug)] pub struct Spacer { pub space: f32, pub visible: bool, } +impl fmt::Debug for Spacer { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + debug_impls::spacer(self, f) + } +} + impl Spacer { pub fn new(space: f32, visible: bool) -> Spacer { Spacer { space, visible } diff --git a/src/text.rs b/src/text.rs index 1b42dc83..1f71f478 100644 --- a/src/text.rs +++ b/src/text.rs @@ -1,10 +1,14 @@ +use std::fmt; + +use crate::debug_impls; use crate::utils::{Align, Line, Point, Rect, Selection, Size}; + use wgpu_glyph::{ ab_glyph::{Font, FontArc, PxScale}, Extra, FontId, GlyphCruncher, HorizontalAlign, Layout, Section, SectionGlyph, }; -#[derive(Clone, Debug, Default)] +#[derive(Clone)] pub struct TextBox { pub indent: f32, pub texts: Vec, @@ -18,6 +22,28 @@ pub struct TextBox { pub background_color: Option<[f32; 4]>, } +impl fmt::Debug for TextBox { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + debug_impls::text_box(self, f) + } +} + +impl Default for TextBox { + fn default() -> Self { + Self { + indent: 0.0, + texts: Vec::new(), + is_code_block: false, + is_quote_block: None, + is_checkbox: None, + is_anchor: None, + align: Align::default(), + hidpi_scale: 1.0, + padding_height: 0.0, + background_color: None, + } + } +} impl TextBox { pub fn new(texts: Vec, hidpi_scale: f32) -> TextBox { TextBox { @@ -249,7 +275,7 @@ impl TextBox { } } -#[derive(Debug, Clone, Default)] +#[derive(Clone, Default)] pub struct Text { pub text: String, pub size: f32, @@ -264,6 +290,12 @@ pub struct Text { pub default_color: [f32; 4], } +impl fmt::Debug for Text { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + debug_impls::text(self, f) + } +} + impl Text { pub fn new(text: String, hidpi_scale: f32, default_text_color: [f32; 4]) -> Self { Self { @@ -317,12 +349,13 @@ impl Text { fn font_id(&self) -> FontId { let base = self.font * 4; - let font = base + match (self.is_bold, self.is_italic) { - (false, false) => 0, - (false, true) => 1, - (true, false) => 2, - (true, true) => 3, - }; + let font = base + + match (self.is_bold, self.is_italic) { + (false, false) => 0, + (false, true) => 1, + (true, false) => 2, + (true, true) => 3, + }; FontId(font) } From de42d67303512d03b0cc8405e52a59e62b98b7cb Mon Sep 17 00:00:00 2001 From: CosmicHorror Date: Fri, 2 Jun 2023 20:54:35 -0600 Subject: [PATCH 08/26] Interpreter test tweaks (#138) * Cleanup existing custom debug impls * Add custom debug impls for `Element::Image(_)` * Add a snapshot test for complex image elements --- Cargo.lock | 225 ++++++++++++++++-- Cargo.toml | 1 + src/debug_impls.rs | 98 +++++--- src/image/mod.rs | 23 +- ...ntered_image_with_size_align_and_link.snap | 32 +++ ...__tests__checklist_has_no_text_prefix.snap | 37 +++ .../inlyne__interpreter__tests__sanity.snap | 4 + src/interpreter/tests.rs | 52 +++- tests/assets/bun_logo.png | Bin 0 -> 19767 bytes 9 files changed, 425 insertions(+), 47 deletions(-) create mode 100644 src/interpreter/snapshots/inlyne__interpreter__tests__centered_image_with_size_align_and_link.snap create mode 100644 src/interpreter/snapshots/inlyne__interpreter__tests__checklist_has_no_text_prefix.snap create mode 100644 tests/assets/bun_logo.png diff --git a/Cargo.lock b/Cargo.lock index df94bcce..91efc54d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -39,7 +39,7 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom", + "getrandom 0.2.9", "once_cell", "version_check", ] @@ -171,6 +171,16 @@ dependencies = [ "libloading 0.7.4", ] +[[package]] +name = "assert-json-diff" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47e4f2b81832e72834d7518d8487a0396a28cc408186a2e8854c0f98011faf12" +dependencies = [ + "serde", + "serde_json", +] + [[package]] name = "async-broadcast" version = "0.5.1" @@ -302,6 +312,12 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + [[package]] name = "base64" version = "0.21.0" @@ -793,6 +809,25 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7046468a81e6a002061c01e6a7c83139daf91b11c30e66795b13217c2d885c8b" +[[package]] +name = "deadpool" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "421fe0f90f2ab22016f32a9881be5134fdd71c65298917084b0c7477cbc3856e" +dependencies = [ + "async-trait", + "deadpool-runtime", + "num_cpus", + "retain_mut", + "tokio", +] + +[[package]] +name = "deadpool-runtime" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaa37046cc0f6c3cc6090fbdbf73ef0b8ef4cfcc37f6befc0020f63e8cf121e1" + [[package]] name = "derivative" version = "2.2.0" @@ -1247,6 +1282,21 @@ dependencies = [ "new_debug_unreachable", ] +[[package]] +name = "futures" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + [[package]] name = "futures-channel" version = "0.3.28" @@ -1254,6 +1304,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" dependencies = [ "futures-core", + "futures-sink", ] [[package]] @@ -1262,6 +1313,17 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +[[package]] +name = "futures-executor" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + [[package]] name = "futures-io" version = "0.3.28" @@ -1306,12 +1368,19 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +[[package]] +name = "futures-timer" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" + [[package]] name = "futures-util" version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ + "futures-channel", "futures-core", "futures-io", "futures-macro", @@ -1343,6 +1412,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + [[package]] name = "getrandom" version = "0.2.9" @@ -1352,7 +1432,7 @@ dependencies = [ "cfg-if", "js-sys", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "wasm-bindgen", ] @@ -1589,6 +1669,27 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "http-types" +version = "2.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e9b187a72d63adbfba487f48095306ac823049cb504ee195541e91c7775f5ad" +dependencies = [ + "anyhow", + "async-channel", + "base64 0.13.1", + "futures-lite", + "http", + "infer", + "pin-project-lite", + "rand 0.7.3", + "serde", + "serde_json", + "serde_qs", + "serde_urlencoded", + "url", +] + [[package]] name = "httparse" version = "1.8.0" @@ -1689,6 +1790,12 @@ dependencies = [ "hashbrown", ] +[[package]] +name = "infer" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64e9829a50b42bb782c1df523f78d332fe371b10c661e78b7a3c34b0198e9fac" + [[package]] name = "inlyne" version = "0.3.1" @@ -1723,6 +1830,7 @@ dependencies = [ "wgpu", "wgpu_glyph", "winit", + "wiremock", ] [[package]] @@ -2172,7 +2280,7 @@ checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" dependencies = [ "libc", "log", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.45.0", ] @@ -2202,7 +2310,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" dependencies = [ - "getrandom", + "getrandom 0.2.9", ] [[package]] @@ -2700,7 +2808,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" dependencies = [ "phf_shared", - "rand", + "rand 0.8.5", ] [[package]] @@ -2762,7 +2870,7 @@ version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bd9647b268a3d3e14ff09c23201133a62589c658db02bb7388c7246aafe0590" dependencies = [ - "base64", + "base64 0.21.0", "indexmap", "line-wrap", "quick-xml", @@ -2881,6 +2989,19 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + [[package]] name = "rand" version = "0.8.5" @@ -2888,8 +3009,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha", - "rand_core", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", ] [[package]] @@ -2899,7 +3030,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", ] [[package]] @@ -2908,7 +3048,16 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom", + "getrandom 0.2.9", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", ] [[package]] @@ -2975,7 +3124,7 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ - "getrandom", + "getrandom 0.2.9", "redox_syscall 0.2.16", "thiserror", ] @@ -3015,7 +3164,7 @@ version = "0.11.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13293b639a097af28fc8a90f22add145a9c954e49d77da06263d58cf44d5fb91" dependencies = [ - "base64", + "base64 0.21.0", "bytes", "encoding_rs", "futures-core", @@ -3066,6 +3215,12 @@ dependencies = [ "usvg", ] +[[package]] +name = "retain_mut" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4389f1d5789befaf6029ebd9f7dac4af7f7e3d61b69d4f30e2ac02b57e7712b0" + [[package]] name = "rgb" version = "0.8.36" @@ -3285,6 +3440,17 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_qs" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7715380eec75f029a4ef7de39a9200e0a63823176b759d055b613f5a87df6a6" +dependencies = [ + "percent-encoding", + "serde", + "thiserror", +] + [[package]] name = "serde_repr" version = "0.1.12" @@ -3853,7 +4019,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ "cfg-if", - "rand", + "rand 0.8.5", "static_assertions", ] @@ -3963,6 +4129,7 @@ dependencies = [ "form_urlencoded", "idna", "percent-encoding", + "serde", ] [[package]] @@ -3971,7 +4138,7 @@ version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b44e14b7678bcc5947b397991432d0c4e02a103958a0ed5e1b9b961ddd08b21" dependencies = [ - "base64", + "base64 0.21.0", "log", "pico-args", "usvg-parser", @@ -4081,6 +4248,12 @@ dependencies = [ "try-lock", ] +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -4631,6 +4804,28 @@ dependencies = [ "winapi", ] +[[package]] +name = "wiremock" +version = "0.5.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "079aee011e8a8e625d16df9e785de30a6b77f80a6126092d76a57375f96448da" +dependencies = [ + "assert-json-diff", + "async-trait", + "base64 0.21.0", + "deadpool", + "futures", + "futures-timer", + "http-types", + "hyper", + "log", + "once_cell", + "regex", + "serde", + "serde_json", + "tokio", +] + [[package]] name = "x11-clipboard" version = "0.7.1" @@ -4768,7 +4963,7 @@ dependencies = [ "nix 0.26.2", "once_cell", "ordered-stream", - "rand", + "rand 0.8.5", "serde", "serde_repr", "sha1", diff --git a/Cargo.toml b/Cargo.toml index 8be4e277..80324b81 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,3 +53,4 @@ lto = true [dev-dependencies] insta = "1.34.0" pretty_assertions = "1.3.0" +wiremock = "0.5.18" diff --git a/src/debug_impls.rs b/src/debug_impls.rs index 0157a9aa..ec4d7bf0 100644 --- a/src/debug_impls.rs +++ b/src/debug_impls.rs @@ -7,6 +7,7 @@ use std::fmt; use crate::{ positioner::Spacer, text::{Text, TextBox}, + Image, }; pub struct DebugF32Color(pub [f32; 4]); @@ -29,14 +30,34 @@ impl fmt::Debug for DebugF32Color { } } -pub struct DebugInlineOption<'inner, T>(pub &'inner Option); +struct DebugInline<'inner, T>(&'inner T); -impl<'inner, T: fmt::Debug> fmt::Debug for DebugInlineOption<'inner, T> { +impl<'inner, T: fmt::Debug> fmt::Debug for DebugInline<'inner, T> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - if let Some(t) = &self.0 { - f.write_fmt(format_args!("Some({t:?})")) - } else { - f.write_str("None") + f.write_fmt(format_args!("{:?}", self.0)) + } +} + +fn debug_inline_some( + debug: &mut fmt::DebugStruct<'_, '_>, + name: &'static str, + maybe_t: &Option, +) { + if maybe_t.is_some() { + debug.field(name, &DebugInline(maybe_t)); + } +} + +struct DebugBytesPrefix<'a>(&'a [u8]); + +impl<'a> fmt::Debug for DebugBytesPrefix<'a> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self.0 { + [x, y, z, _, ..] => { + let len = self.0.len(); + f.write_fmt(format_args!("{{ len: {len}, data: [{x}, {y}, {z}, ..] }}")) + } + three_or_less => f.write_fmt(format_args!("{three_or_less:?}")), } } } @@ -69,28 +90,19 @@ pub fn text_box(text_box: &TextBox, f: &mut fmt::Formatter<'_>) -> fmt::Result { if *padding_height != default.padding_height { debug.field("padding_height", padding_height); } - if background_color.is_some() { - let background_color = background_color.map(DebugF32Color); - let debug_background_color = DebugInlineOption(&background_color); - debug.field("background_color", &debug_background_color); - } + let background_color = background_color.map(DebugF32Color); + debug_inline_some(&mut debug, "background_color", &background_color); if *is_code_block { - debug.field("is_code_block", &true); - } - if is_quote_block.is_some() { - debug.field("is_quote_block", &DebugInlineOption(is_quote_block)); - } - if is_checkbox.is_some() { - debug.field("is_checkbox", &DebugInlineOption(is_checkbox)); - } - if is_anchor.is_some() { - debug.field("is_anchor", &DebugInlineOption(is_anchor)); + debug.field("is_code_block", &is_code_block); } + debug_inline_some(&mut debug, "is_quote_block", is_quote_block); + debug_inline_some(&mut debug, "is_checkbox", is_checkbox); + debug_inline_some(&mut debug, "is_anchor", is_anchor); // Texts at the end so all the smaller fields for text box are easily visible debug.field("texts", texts); - debug.finish() + debug.finish_non_exhaustive() } pub fn text(text: &Text, f: &mut fmt::Formatter<'_>) -> fmt::Result { @@ -173,8 +185,7 @@ pub fn text(text: &Text, f: &mut fmt::Formatter<'_>) -> fmt::Result { debug.field("default_color", &DebugF32Color(*default_color)); } else { let color = color.map(DebugF32Color); - let debug_color = DebugInlineOption(&color); - debug.field("color", &debug_color); + debug.field("color", &DebugInline(&color)); } let style = StyleWrapper { is_bold: *is_bold, @@ -185,11 +196,9 @@ pub fn text(text: &Text, f: &mut fmt::Formatter<'_>) -> fmt::Result { if !style.is_regular() { debug.field("style", &style); } - if link.is_some() { - debug.field("link", &DebugInlineOption(link)); - } + debug_inline_some(&mut debug, "link", link); - debug.finish() + debug.finish_non_exhaustive() } pub fn spacer(spacer: &Spacer, f: &mut fmt::Formatter<'_>) -> fmt::Result { @@ -201,3 +210,36 @@ pub fn spacer(spacer: &Spacer, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_fmt(format_args!("InvisibleSpacer({space})")) } } + +pub fn image(image: &Image, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let Image { + image_data, + is_aligned, + size, + bind_group: _, + is_link, + hidpi_scale: _, + } = image; + + let mut debug = f.debug_struct("Image"); + + debug.field("image_data", image_data); + debug_inline_some(&mut debug, "is_aligned", is_aligned); + debug_inline_some(&mut debug, "size", size); + debug_inline_some(&mut debug, "is_link", is_link); + + debug.finish_non_exhaustive() +} + +pub fn image_data( + (lz4_blob, scale, dimensions): (&[u8], &bool, &(u32, u32)), + f: &mut fmt::Formatter<'_>, +) -> fmt::Result { + let mut debug = f.debug_struct("ImageData"); + + debug.field("lz4_blob", &DebugBytesPrefix(lz4_blob)); + debug.field("scale", scale); + debug.field("dimensions", &DebugInline(dimensions)); + + debug.finish() +} diff --git a/src/image/mod.rs b/src/image/mod.rs index 4055fbe8..6e7e7249 100644 --- a/src/image/mod.rs +++ b/src/image/mod.rs @@ -1,9 +1,11 @@ +use crate::debug_impls; use crate::interpreter::ImageCallback; use crate::positioner::DEFAULT_MARGIN; use crate::utils::{usize_in_mib, Align, Point, Size}; use anyhow::Context; use bytemuck::{Pod, Zeroable}; use image::{ImageBuffer, RgbaImage}; +use std::fmt; use std::fs; use std::io; use std::path::PathBuf; @@ -25,13 +27,24 @@ pub enum ImageSize { PxHeight(u32), } -#[derive(Debug, Default, Clone)] +#[derive(Default, Clone)] pub struct ImageData { lz4_blob: Vec, scale: bool, dimensions: (u32, u32), } +impl fmt::Debug for ImageData { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let Self { + lz4_blob, + scale, + dimensions, + } = self; + debug_impls::image_data((lz4_blob, scale, dimensions), f) + } +} + impl ImageData { fn load(bytes: &[u8], scale: bool) -> anyhow::Result { let (lz4_blob, dimensions) = decode::decode_and_compress(bytes)?; @@ -73,7 +86,7 @@ impl ImageData { } } -#[derive(Default, Debug)] +#[derive(Default)] pub struct Image { pub image_data: Arc>>, pub is_aligned: Option, @@ -83,6 +96,12 @@ pub struct Image { pub hidpi_scale: f32, } +impl fmt::Debug for Image { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + debug_impls::image(self, f) + } +} + impl Image { pub fn create_bind_group( &mut self, diff --git a/src/interpreter/snapshots/inlyne__interpreter__tests__centered_image_with_size_align_and_link.snap b/src/interpreter/snapshots/inlyne__interpreter__tests__centered_image_with_size_align_and_link.snap new file mode 100644 index 00000000..5f1d7c6e --- /dev/null +++ b/src/interpreter/snapshots/inlyne__interpreter__tests__centered_image_with_size_align_and_link.snap @@ -0,0 +1,32 @@ +--- +source: src/interpreter/tests.rs +description: "\n

\n \"Logo\"\n

" +expression: interpret_md(&text) +--- +[ + Image( + Image { + image_data: Mutex { + data: Some( + ImageData { + lz4_blob: { len: 21244, data: [4, 34, 77, ..] }, + scale: true, + dimensions: (396, 347), + }, + ), + poisoned: false, + .. + }, + is_aligned: Some(Center), + size: Some(PxHeight(170)), + is_link: Some("https://bun.sh"), + .. + }, + ), + Spacer( + InvisibleSpacer(5), + ), + Spacer( + InvisibleSpacer(5), + ), +] diff --git a/src/interpreter/snapshots/inlyne__interpreter__tests__checklist_has_no_text_prefix.snap b/src/interpreter/snapshots/inlyne__interpreter__tests__checklist_has_no_text_prefix.snap new file mode 100644 index 00000000..8515f092 --- /dev/null +++ b/src/interpreter/snapshots/inlyne__interpreter__tests__checklist_has_no_text_prefix.snap @@ -0,0 +1,37 @@ +--- +source: src/interpreter/tests.rs +expression: interpret_md(text) +--- +[ + TextBox( + TextBox { + indent: 50.0, + is_checkbox: Some(true), + texts: [ + Text { + text: "Completed task", + default_color: Color(BLACK), + .. + }, + ], + .. + }, + ), + TextBox( + TextBox { + indent: 50.0, + is_checkbox: Some(false), + texts: [ + Text { + text: "Incomplete task", + default_color: Color(BLACK), + .. + }, + ], + .. + }, + ), + Spacer( + InvisibleSpacer(5), + ), +] diff --git a/src/interpreter/snapshots/inlyne__interpreter__tests__sanity.snap b/src/interpreter/snapshots/inlyne__interpreter__tests__sanity.snap index 51dc3f8a..4986718d 100644 --- a/src/interpreter/snapshots/inlyne__interpreter__tests__sanity.snap +++ b/src/interpreter/snapshots/inlyne__interpreter__tests__sanity.snap @@ -15,8 +15,10 @@ expression: interpret_md(text) size: 32.0, default_color: Color(BLACK), style: BOLD UNDERLINED , + .. }, ], + .. }, ), Spacer( @@ -29,8 +31,10 @@ expression: interpret_md(text) text: "Italicized text", default_color: Color(BLACK), style: ITALIC , + .. }, ], + .. }, ), Spacer( diff --git a/src/interpreter/tests.rs b/src/interpreter/tests.rs index ff0ddc73..a5ab06e5 100644 --- a/src/interpreter/tests.rs +++ b/src/interpreter/tests.rs @@ -1,6 +1,7 @@ use std::{ collections::VecDeque, - path::PathBuf, + fs, + path::{Path, PathBuf}, sync::{ atomic::{AtomicU32, Ordering}, mpsc, Arc, Mutex, @@ -13,6 +14,7 @@ use super::{HtmlInterpreter, ImageCallback, WindowInteractor}; use crate::{color::LIGHT_DEFAULT, image::ImageData, Element, ImageCache}; use wgpu::TextureFormat; +use wiremock::{matchers, Mock, MockServer, ResponseTemplate}; // We use a dummy window with an internal counter that keeps track of when rendering a single md // document is finished @@ -123,4 +125,50 @@ const SANITY: &str = "\ _Italicized text_"; -snapshot_interpreted_elements!((sanity, SANITY)); +const CHECKLIST_HAS_NO_TEXT_PREFIX: &str = "\ +- [x] Completed task +- [ ] Incomplete task"; + +snapshot_interpreted_elements!( + (sanity, SANITY), + (checklist_has_no_text_prefix, CHECKLIST_HAS_NO_TEXT_PREFIX), +); + +/// Spin up a server, so we can test network requests without external services +fn mock_file_server(url_path: &str, mime: &str, file_path: &Path) -> (MockServer, String) { + let bytes = fs::read(file_path).unwrap(); + let setup_server = async { + let mock_server = MockServer::start().await; + Mock::given(matchers::method("GET")) + .and(matchers::path(url_path)) + .respond_with(ResponseTemplate::new(200).set_body_raw(bytes, mime)) + .mount(&mock_server) + .await; + mock_server + }; + let server = pollster::block_on(setup_server); + + let full_url = format!("{}{}", server.uri(), url_path); + (server, full_url) +} + +#[test] +fn centered_image_with_size_align_and_link() { + let logo_path = Path::new("tests").join("assets").join("bun_logo.png"); + let (_server, logo_url) = mock_file_server("/bun_logo.png", "image/png", &logo_path); + + let text = format!( + r#" +

+ Logo +

"#, + ); + + insta::with_settings!({ + // The port for the URL here is non-deterministic, but the description changing doesn't + // invalidate the snapshot, so that's okay + description => &text, + }, { + insta::assert_debug_snapshot!(interpret_md(&text)); + }); +} diff --git a/tests/assets/bun_logo.png b/tests/assets/bun_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..a6469e481219b0a27dc4f0d466de5590ffcd5d70 GIT binary patch literal 19767 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 Date: Tue, 20 Jun 2023 19:49:05 -0600 Subject: [PATCH 09/26] More robust file watching (#147) * The watcher should attempt to re-register on name changes * Re-register watcher after longer delays * Add a reminder for fixing watching after file changes * Move file watcher into its own file * Make file watcher testable * Watcher follows file changes * Test the file watcher * Final test tweaks * Swap back to the old delays * Final final test tweaks * Use a slightly longer delay * Shorter poll interval for file watcher * Follow through with rename --- Cargo.lock | 9 ++-- Cargo.toml | 2 + src/main.rs | 63 +++------------------- src/watcher/mod.rs | 123 +++++++++++++++++++++++++++++++++++++++++++ src/watcher/tests.rs | 83 +++++++++++++++++++++++++++++ 5 files changed, 221 insertions(+), 59 deletions(-) create mode 100644 src/watcher/mod.rs create mode 100644 src/watcher/tests.rs diff --git a/Cargo.lock b/Cargo.lock index 91efc54d..e63e6b3f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1809,6 +1809,7 @@ dependencies = [ "dark-light", "dirs 5.0.1", "env_logger", + "filetime", "font-kit", "html5ever", "image", @@ -1824,6 +1825,7 @@ dependencies = [ "reqwest", "resvg", "serde", + "tempfile", "tiny-skia 0.9.0", "toml", "usvg", @@ -3727,15 +3729,16 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.5.0" +version = "3.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" +checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" dependencies = [ + "autocfg", "cfg-if", "fastrand", "redox_syscall 0.3.5", "rustix", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 80324b81..44facc4d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -51,6 +51,8 @@ strip = true lto = true [dev-dependencies] +filetime = "0.2.21" insta = "1.34.0" pretty_assertions = "1.3.0" +tempfile = "3.6.0" wiremock = "0.5.18" diff --git a/src/main.rs b/src/main.rs index b83ed447..39670121 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,12 +10,14 @@ pub mod renderer; pub mod table; pub mod text; pub mod utils; +mod watcher; use crate::image::Image; use crate::interpreter::HtmlInterpreter; use crate::opts::Opts; use crate::table::Table; use crate::text::Text; +use watcher::Watcher; use crate::image::ImageData; use keybindings::{Action, Key, KeyCombos, ModifiedKey}; @@ -33,7 +35,6 @@ use utils::{ImageCache, Point, Rect, Size}; use anyhow::Context; use copypasta::{ClipboardContext, ClipboardProvider}; -use notify::{RecommendedWatcher, RecursiveMode, Watcher}; use winit::event::ModifiersState; use winit::event::{ElementState, MouseButton}; @@ -57,7 +58,6 @@ use std::sync::mpsc; use std::sync::mpsc::channel; use std::sync::Arc; use std::sync::Mutex; -use std::time::Duration; pub enum InlyneEvent { LoadedImage(String, Arc>>), @@ -137,6 +137,7 @@ pub struct Inlyne { interpreter_should_queue: Arc, keycombos: KeyCombos, need_repositioning: bool, + watcher: Watcher, } /// Gets a relative path extending from the repo root falling back to the full path @@ -173,55 +174,6 @@ fn root_filepath_to_vcs_dir(path: &Path) -> Option { } impl Inlyne { - pub fn spawn_watcher(&self) { - // Create a channel to receive the events. - let (watch_tx, watch_rx) = channel(); - - // Create a watcher object, delivering raw events. - // The notification back-end is selected based on the platform. - let mut watcher = RecommendedWatcher::new(watch_tx, notify::Config::default()).unwrap(); - - // Add the file path to be watched. - let event_proxy = self.event_loop.create_proxy(); - let file_path = self.opts.file_path.clone(); - std::thread::spawn(move || { - watcher - .watch(&file_path, RecursiveMode::NonRecursive) - .unwrap(); - - loop { - let event = match watch_rx.recv() { - Ok(Ok(event)) => event, - Ok(Err(err)) => { - log::warn!("File watcher error: {}", err); - continue; - } - Err(err) => { - log::warn!("File watcher channel dropped unexpectedly: {}", err); - break; - } - }; - - log::debug!("File event: {:#?}", event); - if event.kind.is_modify() { - let _ = event_proxy.send_event(InlyneEvent::FileReload); - } else if event.kind.is_remove() { - // Some editors may remove/rename the file as a part of saving. - // Reregister file watching in this case - std::thread::sleep(Duration::from_millis(10)); - log::info!( - "File may have been renamed/removed. Attempting to re-register file watcher" - ); - - let _ = watcher.unwatch(&file_path); - if let Err(err) = watcher.watch(&file_path, RecursiveMode::NonRecursive) { - log::warn!("Unable to watch file. No longer reloading: {}", err); - } - } - } - }); - } - pub fn new(opts: Opts) -> anyhow::Result { let keycombos = KeyCombos::new(opts.keybindings.clone())?; @@ -264,6 +216,8 @@ impl Inlyne { let lines_to_scroll = opts.lines_to_scroll; + let watcher = Watcher::spawn(event_loop.create_proxy(), opts.file_path.clone()); + Ok(Self { opts, window, @@ -278,6 +232,7 @@ impl Inlyne { image_cache, keycombos, need_repositioning: false, + watcher, }) } @@ -527,9 +482,7 @@ impl Inlyne { .expect("Could not spawn new inlyne instance"); } else { self.opts.file_path = path; - event_loop_proxy - .send_event(InlyneEvent::FileReload) - .expect("new file to reload successfully"); + self.watcher.update_path(&self.opts.file_path); } } else if open::that(link).is_err() { if let Some(anchor_pos) = @@ -750,8 +703,6 @@ fn main() -> anyhow::Result<()> { }; let opts = Opts::parse_and_load_from(args, config); let inlyne = Inlyne::new(opts)?; - - inlyne.spawn_watcher(); inlyne.run(); Ok(()) diff --git a/src/watcher/mod.rs b/src/watcher/mod.rs new file mode 100644 index 00000000..aa755a1c --- /dev/null +++ b/src/watcher/mod.rs @@ -0,0 +1,123 @@ +use std::{ + path::{Path, PathBuf}, + sync::mpsc, + time::Duration, +}; + +use crate::InlyneEvent; + +use notify::{ + event::{EventKind, ModifyKind}, + Event, EventHandler, RecommendedWatcher, RecursiveMode, Watcher as _, +}; +use winit::event_loop::EventLoopProxy; + +#[cfg(test)] +mod tests; + +trait Callback: Send + 'static { + fn update(&self); +} + +impl Callback for EventLoopProxy { + fn update(&self) { + let _ = self.send_event(InlyneEvent::FileReload); + } +} + +enum WatcherMsg { + // Sent by the registered file watcher + Notify(notify::Result), + // Sent by the event loop + FileChange(PathBuf), +} + +struct MsgHandler(mpsc::Sender); + +impl EventHandler for MsgHandler { + fn handle_event(&mut self, event: notify::Result) { + let msg = WatcherMsg::Notify(event); + let _ = self.0.send(msg); + } +} + +pub struct Watcher(mpsc::Sender); + +impl Watcher { + pub fn spawn(event_proxy: EventLoopProxy, file_path: PathBuf) -> Self { + Self::spawn_inner(event_proxy, file_path) + } + + fn spawn_inner(reload_callback: C, file_path: PathBuf) -> Self { + let (msg_tx, msg_rx) = mpsc::channel(); + let watcher = Self(msg_tx.clone()); + + let notify_watcher = + RecommendedWatcher::new(MsgHandler(msg_tx), notify::Config::default()).unwrap(); + + std::thread::spawn(move || { + endlessly_handle_messages(notify_watcher, msg_rx, reload_callback, file_path); + }); + + watcher + } + + pub fn update_path(&self, new_path: &Path) { + let msg = WatcherMsg::FileChange(new_path.to_owned()); + let _ = self.0.send(msg); + } +} + +fn endlessly_handle_messages( + mut watcher: RecommendedWatcher, + msg_rx: mpsc::Receiver, + reload_callback: C, + mut file_path: PathBuf, +) { + watcher + .watch(&file_path, RecursiveMode::NonRecursive) + .unwrap(); + + let poll_registering_watcher = |watcher: &mut RecommendedWatcher, file_path: &Path| loop { + std::thread::sleep(Duration::from_millis(20)); + + let _ = watcher.unwatch(file_path); + if watcher + .watch(file_path, RecursiveMode::NonRecursive) + .is_ok() + { + break; + } + }; + + while let Ok(msg) = msg_rx.recv() { + match msg { + WatcherMsg::Notify(Ok(event)) => { + log::trace!("File event: {:#?}", event); + + if matches!( + event.kind, + EventKind::Remove(_) | EventKind::Modify(ModifyKind::Name(_)) + ) { + log::debug!("File may have been renamed/removed. Falling back to polling"); + poll_registering_watcher(&mut watcher, &file_path); + log::debug!("Successfully re-registered file watcher"); + reload_callback.update(); + } else if matches!(event.kind, EventKind::Modify(_)) { + log::debug!("Reloading file"); + reload_callback.update(); + } + } + WatcherMsg::Notify(Err(err)) => log::warn!("File watcher error: {}", err), + WatcherMsg::FileChange(new_path) => { + log::info!("Updating file watcher path: {}", new_path.display()); + let _ = watcher.unwatch(&file_path); + poll_registering_watcher(&mut watcher, &new_path); + file_path = new_path; + reload_callback.update(); + } + } + } + + log::warn!("File watcher channel dropped unexpectedly"); +} diff --git a/src/watcher/tests.rs b/src/watcher/tests.rs new file mode 100644 index 00000000..dce38a50 --- /dev/null +++ b/src/watcher/tests.rs @@ -0,0 +1,83 @@ +use std::{fs, path::Path, sync::mpsc, time::Duration}; + +use super::{Callback, Watcher}; + +impl Callback for mpsc::Sender<()> { + fn update(&self) { + self.send(()).unwrap(); + } +} + +const DELAY: Duration = Duration::from_millis(100); +const LONG_TIMEOUT: Duration = Duration::from_millis(2_000); +const SHORT_TIMEOUT: Duration = Duration::from_millis(50); + +fn delay() { + std::thread::sleep(DELAY); +} + +fn touch(file: &Path) { + let now = filetime::FileTime::now(); + filetime::set_file_mtime(file, now).unwrap(); +} + +#[track_caller] +fn assert_no_message(callback: &mpsc::Receiver<()>) { + assert!(callback.recv_timeout(SHORT_TIMEOUT).is_err()); +} + +#[track_caller] +fn assert_at_least_one_message(callback: &mpsc::Receiver<()>) { + assert!(callback.recv_timeout(LONG_TIMEOUT).is_ok()); + while callback.recv_timeout(SHORT_TIMEOUT).is_ok() {} +} + +// Unfortunately this needs to be littered with sleeps/timeouts to work right :/ +#[test] +fn the_gauntlet() { + // Create our dummy test env + let temp_dir = tempfile::Builder::new() + .prefix("inlyne-tests-") + .tempdir() + .unwrap(); + let base = temp_dir.path(); + let main_file = base.join("main.md"); + let rel_file = base.join("rel.md"); + let swapped_in_file = base.join("swap_me_in.md"); + let swapped_out_file = base.join("swap_out_to_me.md"); + fs::write(&main_file, "# Main\n\n[rel](./rel.md)").unwrap(); + fs::write(&rel_file, "# Rel").unwrap(); + fs::write(&swapped_in_file, "# Swapped").unwrap(); + + // Setup our watcher + let (callback_tx, callback_rx) = mpsc::channel::<()>(); + let watcher = Watcher::spawn_inner(callback_tx, main_file.clone()); + + // Give the watcher time to get comfy :) + delay(); + + // Sanity check watching + touch(&main_file); + assert_at_least_one_message(&callback_rx); + + // Updating a file follows the new file and not the old one + watcher.update_path(&rel_file); + assert_at_least_one_message(&callback_rx); + touch(&main_file); + assert_no_message(&callback_rx); + touch(&rel_file); + assert_at_least_one_message(&callback_rx); + + // We can slowly swap out the file and it will only follow the file it's supposed to + fs::rename(&rel_file, &swapped_out_file).unwrap(); + touch(&swapped_out_file); + assert_no_message(&callback_rx); + // The "slowly" part of this (give the watcher time to fail and start polling) + delay(); + fs::rename(&swapped_in_file, &rel_file).unwrap(); + assert_at_least_one_message(&callback_rx); + fs::remove_file(&swapped_out_file).unwrap(); + assert_no_message(&callback_rx); + touch(&rel_file); + assert_at_least_one_message(&callback_rx); +} From cc2c1dc6d454ad876485e34e20d47a1c6230e5b3 Mon Sep 17 00:00:00 2001 From: CosmicHorror Date: Tue, 20 Jun 2023 20:30:21 -0600 Subject: [PATCH 10/26] Make file reloading less panic happy (#145) * Rework panic happy file reloading * Tweak logs * The watcher should attempt to re-register on name changes * Re-register watcher after longer delays --- src/main.rs | 102 ++++++++++++++++++++++++++++++++----------- src/watcher/mod.rs | 26 +++++++---- src/watcher/tests.rs | 8 +++- 3 files changed, 100 insertions(+), 36 deletions(-) diff --git a/src/main.rs b/src/main.rs index 39670121..17bba6f0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -62,6 +62,7 @@ use std::sync::Mutex; pub enum InlyneEvent { LoadedImage(String, Arc>>), FileReload, + FileChange { contents: String }, Reposition, } @@ -126,7 +127,9 @@ impl From
for Element { pub struct Inlyne { opts: Opts, window: Arc, - event_loop: EventLoop, + // HACK: `Option<_>` is used here to keep `Inlyne` valid while running the event loop. Consider + // splitting this out from the rest of the state + event_loop: Option>, renderer: Renderer, element_queue: Arc>>, clipboard: ClipboardContext, @@ -221,7 +224,7 @@ impl Inlyne { Ok(Self { opts, window, - event_loop, + event_loop: Some(event_loop), renderer, element_queue, clipboard, @@ -236,6 +239,47 @@ impl Inlyne { }) } + pub fn position_queued_elements( + element_queue: &Arc>>, + renderer: &mut Renderer, + elements: &mut Vec>, + ) { + let queue = { + element_queue + .try_lock() + .map(|mut queue| queue.drain(..).collect::>()) + }; + if let Ok(queue) = queue { + for element in queue { + // Position element and add it to elements + let mut positioned_element = Positioned::new(element); + renderer + .positioner + .position( + &mut renderer.glyph_brush, + &mut positioned_element, + renderer.zoom, + ) + .unwrap(); + renderer.positioner.reserved_height += + DEFAULT_PADDING * renderer.hidpi_scale * renderer.zoom + + positioned_element.bounds.as_ref().unwrap().size.1; + elements.push(positioned_element); + } + } + } + + fn load_file(&mut self, contents: String) { + self.interpreter_should_queue + .store(false, Ordering::Relaxed); + self.element_queue.lock().unwrap().clear(); + self.elements.clear(); + self.renderer.positioner.reserved_height = DEFAULT_PADDING * self.renderer.hidpi_scale; + self.renderer.positioner.anchors.clear(); + self.interpreter_should_queue.store(true, Ordering::Relaxed); + self.interpreter_sender.send(contents).unwrap(); + } + pub fn run(mut self) { let mut pending_resize = None; let mut scrollbar_held = None; @@ -244,8 +288,10 @@ impl Inlyne { let mut last_loc = (0.0, 0.0); let mut selection_cache = String::new(); let mut selecting = false; - let event_loop_proxy = self.event_loop.create_proxy(); - self.event_loop.run(move |event, _, control_flow| { + + let event_loop = self.event_loop.take().unwrap(); + let event_loop_proxy = event_loop.create_proxy(); + event_loop.run(move |event, _, control_flow| { *control_flow = ControlFlow::Wait; match event { @@ -254,25 +300,17 @@ impl Inlyne { self.image_cache.lock().unwrap().insert(src, image_data); self.need_repositioning = true; } - InlyneEvent::FileReload => { - self.interpreter_should_queue - .store(false, Ordering::Relaxed); - self.element_queue.lock().unwrap().clear(); - self.elements.clear(); - self.renderer.positioner.reserved_height = - DEFAULT_PADDING * self.renderer.hidpi_scale; - self.renderer.positioner.anchors.clear(); - let md_string = read_to_string(&self.opts.file_path) - .with_context(|| { - format!( - "Could not read file at '{}'", - self.opts.file_path.display() - ) - }) - .unwrap(); - self.interpreter_should_queue.store(true, Ordering::Relaxed); - self.interpreter_sender.send(md_string).unwrap(); - } + InlyneEvent::FileReload => match read_to_string(&self.opts.file_path) { + Ok(contents) => self.load_file(contents), + Err(err) => { + log::warn!( + "Failed reloading file at {}\nError: {}", + self.opts.file_path.display(), + err + ); + } + }, + InlyneEvent::FileChange { contents } => self.load_file(contents), InlyneEvent::Reposition => { self.need_repositioning = true; } @@ -481,8 +519,22 @@ impl Inlyne { .spawn() .expect("Could not spawn new inlyne instance"); } else { - self.opts.file_path = path; - self.watcher.update_path(&self.opts.file_path); + match read_to_string(&path) { + Ok(contents) => { + self.opts.file_path = path; + self.watcher.update_file( + &self.opts.file_path, + contents, + ); + } + Err(err) => { + log::warn!( + "Failed loading markdown file at {}\nError: {}", + path.display(), + err, + ); + } + } } } else if open::that(link).is_err() { if let Some(anchor_pos) = diff --git a/src/watcher/mod.rs b/src/watcher/mod.rs index aa755a1c..36988ca4 100644 --- a/src/watcher/mod.rs +++ b/src/watcher/mod.rs @@ -16,20 +16,25 @@ use winit::event_loop::EventLoopProxy; mod tests; trait Callback: Send + 'static { - fn update(&self); + fn file_reload(&self); + fn file_change(&self, contents: String); } impl Callback for EventLoopProxy { - fn update(&self) { + fn file_reload(&self) { let _ = self.send_event(InlyneEvent::FileReload); } + + fn file_change(&self, contents: String) { + let _ = self.send_event(InlyneEvent::FileChange { contents }); + } } enum WatcherMsg { // Sent by the registered file watcher Notify(notify::Result), // Sent by the event loop - FileChange(PathBuf), + FileChange { new_path: PathBuf, contents: String }, } struct MsgHandler(mpsc::Sender); @@ -62,8 +67,11 @@ impl Watcher { watcher } - pub fn update_path(&self, new_path: &Path) { - let msg = WatcherMsg::FileChange(new_path.to_owned()); + pub fn update_file(&self, new_path: &Path, contents: String) { + let msg = WatcherMsg::FileChange { + new_path: new_path.to_owned(), + contents, + }; let _ = self.0.send(msg); } } @@ -102,19 +110,19 @@ fn endlessly_handle_messages( log::debug!("File may have been renamed/removed. Falling back to polling"); poll_registering_watcher(&mut watcher, &file_path); log::debug!("Successfully re-registered file watcher"); - reload_callback.update(); + reload_callback.file_reload(); } else if matches!(event.kind, EventKind::Modify(_)) { log::debug!("Reloading file"); - reload_callback.update(); + reload_callback.file_reload(); } } WatcherMsg::Notify(Err(err)) => log::warn!("File watcher error: {}", err), - WatcherMsg::FileChange(new_path) => { + WatcherMsg::FileChange { new_path, contents } => { log::info!("Updating file watcher path: {}", new_path.display()); let _ = watcher.unwatch(&file_path); poll_registering_watcher(&mut watcher, &new_path); file_path = new_path; - reload_callback.update(); + reload_callback.file_change(contents); } } } diff --git a/src/watcher/tests.rs b/src/watcher/tests.rs index dce38a50..10fc478c 100644 --- a/src/watcher/tests.rs +++ b/src/watcher/tests.rs @@ -3,7 +3,11 @@ use std::{fs, path::Path, sync::mpsc, time::Duration}; use super::{Callback, Watcher}; impl Callback for mpsc::Sender<()> { - fn update(&self) { + fn file_reload(&self) { + self.send(()).unwrap(); + } + + fn file_change(&self, _: String) { self.send(()).unwrap(); } } @@ -61,7 +65,7 @@ fn the_gauntlet() { assert_at_least_one_message(&callback_rx); // Updating a file follows the new file and not the old one - watcher.update_path(&rel_file); + watcher.update_file(&rel_file, fs::read_to_string(&rel_file).unwrap()); assert_at_least_one_message(&callback_rx); touch(&main_file); assert_no_message(&callback_rx); From 7dadd14f2bded50990d803cfaac430872398e5e1 Mon Sep 17 00:00:00 2001 From: CosmicHorror Date: Mon, 10 Jul 2023 23:08:11 -0600 Subject: [PATCH 11/26] Improve syntax highlighting (#150) * Add failing test * Use extended syntax definitions * Add failing test * Allow for comma as an info string delimiter --- Cargo.lock | 32 ++++---- Cargo.toml | 11 ++- src/interpreter/mod.rs | 17 +--- ...ter__tests__handles_comma_in_info_str.snap | 42 ++++++++++ ...rpreter__tests__toml_gets_highlighted.snap | 36 +++++++++ src/interpreter/tests.rs | 14 ++++ src/utils.rs | 77 ++++++++++++++++++- 7 files changed, 197 insertions(+), 32 deletions(-) create mode 100644 src/interpreter/snapshots/inlyne__interpreter__tests__handles_comma_in_info_str.snap create mode 100644 src/interpreter/snapshots/inlyne__interpreter__tests__toml_gets_highlighted.snap diff --git a/Cargo.lock b/Cargo.lock index e63e6b3f..c50f6400 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1083,9 +1083,9 @@ dependencies = [ [[package]] name = "fancy-regex" -version = "0.7.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6b8560a05112eb52f04b00e5d3790c0dd75d9d980eb8a122fb23b92a623ccf" +checksum = "b95f7c0680e4142284cf8b22c14a476e87d61b004a3a0861872b32ef7ead40a2" dependencies = [ "bit-set", "regex", @@ -1825,9 +1825,11 @@ dependencies = [ "reqwest", "resvg", "serde", + "syntect", "tempfile", "tiny-skia 0.9.0", "toml", + "two-face", "usvg", "wgpu", "wgpu_glyph", @@ -3139,15 +3141,9 @@ checksum = "af83e617f331cc6ae2da5443c602dfa5af81e517212d9d611a5b3ba1777b5370" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.1", + "regex-syntax", ] -[[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - [[package]] name = "regex-syntax" version = "0.7.1" @@ -3705,22 +3701,20 @@ dependencies = [ [[package]] name = "syntect" -version = "5.0.0" +version = "5.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6c454c27d9d7d9a84c7803aaa3c50cd088d2906fe3c6e42da3209aa623576a8" +checksum = "e02b4b303bf8d08bfeb0445cba5068a3d306b6baece1d5582171a9bf49188f91" dependencies = [ "bincode", "bitflags 1.3.2", "fancy-regex", "flate2", "fnv", - "lazy_static", "once_cell", "onig", "plist", - "regex-syntax 0.6.29", + "regex-syntax", "serde", - "serde_derive", "serde_json", "thiserror", "walkdir", @@ -4015,6 +4009,16 @@ version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44dcf002ae3b32cd25400d6df128c5babec3927cd1eb7ce813cfff20eb6c3746" +[[package]] +name = "two-face" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "655eebf0a106a5b97728bfdc108e76a7f36f069625b328ddf02627ce3d5e9452" +dependencies = [ + "serde", + "syntect", +] + [[package]] name = "twox-hash" version = "1.6.3" diff --git a/Cargo.toml b/Cargo.toml index 44facc4d..54fa9e74 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,10 +40,15 @@ dark-light = "1.0.0" # `checked-decode` lz4_flex = { version = "0.10.0", default-features = false, features = ["frame", "safe-encode", "std"] } pollster = "0.3.0" +syntect = "5.1.0" -# Uncomment for profiling -# [profile.release] -# debug = true +[profile.release] +strip = true + +[dependencies.two-face] +version = "0.1.1" +default-features = false +features = ["extra-syntax"] [profile.release-lto] inherits = "release" diff --git a/src/interpreter/mod.rs b/src/interpreter/mod.rs index 2719467b..2fe48b9c 100644 --- a/src/interpreter/mod.rs +++ b/src/interpreter/mod.rs @@ -13,10 +13,9 @@ use crate::InlyneEvent; use crate::color::Theme; use crate::text::{Text, TextBox}; -use crate::utils::Align; +use crate::utils::{markdown_to_html, Align}; use crate::Element; -use comrak::{markdown_to_html_with_plugins, ComrakOptions}; use html5ever::local_name; use html5ever::tendril::*; use html5ever::tokenizer::BufferQueue; @@ -168,19 +167,9 @@ impl HtmlInterpreter { pub fn interpret_md(self, receiver: mpsc::Receiver) { let mut input = BufferQueue::new(); - let mut options = ComrakOptions::default(); - options.extension.table = true; - options.extension.strikethrough = true; - options.extension.tasklist = true; - options.parse.smart = true; - options.render.unsafe_ = true; - let mut plugins = comrak::ComrakPlugins::default(); - let adapter = comrak::plugins::syntect::SyntectAdapter::new( - self.theme.code_highlighter.as_syntect_name(), - ); - plugins.render.codefence_syntax_highlighter = Some(&adapter); let span_color = native_color(self.theme.code_color, &self.surface_format); + let code_highlighter = self.theme.code_highlighter.clone(); let mut tok = Tokenizer::new(self, TokenizerOpts::default()); for md_string in receiver { @@ -195,7 +184,7 @@ impl HtmlInterpreter { }; tok.sink.current_textbox = TextBox::new(Vec::new(), tok.sink.hidpi_scale); tok.sink.stopped = false; - let htmlified = markdown_to_html_with_plugins(&md_string, &options, &plugins); + let htmlified = markdown_to_html(&md_string, code_highlighter.clone()); input.push_back( Tendril::from_str(&htmlified) diff --git a/src/interpreter/snapshots/inlyne__interpreter__tests__handles_comma_in_info_str.snap b/src/interpreter/snapshots/inlyne__interpreter__tests__handles_comma_in_info_str.snap new file mode 100644 index 00000000..9acd0f3e --- /dev/null +++ b/src/interpreter/snapshots/inlyne__interpreter__tests__handles_comma_in_info_str.snap @@ -0,0 +1,42 @@ +--- +source: src/interpreter/tests.rs +expression: interpret_md(text) +--- +[ + TextBox( + TextBox { + background_color: Some(Color { r: 0.86, g: 0.88, b: 0.91 }), + is_code_block: true, + texts: [ + Text { + text: "let", + size: 18.0, + color: Some(Color { r: 0.46, g: 0.27, b: 0.42 }), + .. + }, + Text { + text: " v = ", + size: 18.0, + color: Some(Color { r: 0.08, g: 0.10, b: 0.13 }), + .. + }, + Text { + text: "1", + size: 18.0, + color: Some(Color { r: 0.63, g: 0.24, b: 0.16 }), + .. + }, + Text { + text: ";", + size: 18.0, + color: Some(Color { r: 0.08, g: 0.10, b: 0.13 }), + .. + }, + ], + .. + }, + ), + Spacer( + InvisibleSpacer(5), + ), +] diff --git a/src/interpreter/snapshots/inlyne__interpreter__tests__toml_gets_highlighted.snap b/src/interpreter/snapshots/inlyne__interpreter__tests__toml_gets_highlighted.snap new file mode 100644 index 00000000..4a69386f --- /dev/null +++ b/src/interpreter/snapshots/inlyne__interpreter__tests__toml_gets_highlighted.snap @@ -0,0 +1,36 @@ +--- +source: src/interpreter/tests.rs +expression: interpret_md(text) +--- +[ + TextBox( + TextBox { + background_color: Some(Color { r: 0.86, g: 0.88, b: 0.91 }), + is_code_block: true, + texts: [ + Text { + text: "key ", + size: 18.0, + color: Some(Color { r: 0.52, g: 0.12, b: 0.14 }), + .. + }, + Text { + text: "= ", + size: 18.0, + color: Some(Color { r: 0.08, g: 0.10, b: 0.13 }), + .. + }, + Text { + text: "123", + size: 18.0, + color: Some(Color { r: 0.63, g: 0.24, b: 0.16 }), + .. + }, + ], + .. + }, + ), + Spacer( + InvisibleSpacer(5), + ), +] diff --git a/src/interpreter/tests.rs b/src/interpreter/tests.rs index a5ab06e5..3e01b5da 100644 --- a/src/interpreter/tests.rs +++ b/src/interpreter/tests.rs @@ -129,9 +129,23 @@ const CHECKLIST_HAS_NO_TEXT_PREFIX: &str = "\ - [x] Completed task - [ ] Incomplete task"; +const TOML_GETS_HIGHLIGHTED: &str = "\ +```toml +key = 123 +``` +"; + +const HANDLES_COMMA_IN_INFO_STR: &str = "\ +```rust,ignore +let v = 1; +``` +"; + snapshot_interpreted_elements!( (sanity, SANITY), (checklist_has_no_text_prefix, CHECKLIST_HAS_NO_TEXT_PREFIX), + (toml_gets_highlighted, TOML_GETS_HIGHLIGHTED), + (handles_comma_in_info_str, HANDLES_COMMA_IN_INFO_STR), ); /// Spin up a server, so we can test network requests without external services diff --git a/src/utils.rs b/src/utils.rs index 4d98e032..919682d9 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -1,12 +1,20 @@ use std::{ collections::HashMap, + io, sync::{Arc, Mutex}, }; +use comrak::{ + adapters::SyntaxHighlighterAdapter, + markdown_to_html_with_plugins, + plugins::syntect::{SyntectAdapter, SyntectAdapterBuilder}, + ComrakOptions, +}; +use syntect::highlighting::{Theme as SyntectTheme, ThemeSet as SyntectThemeSet}; use wgpu_glyph::ab_glyph; use winit::window::CursorIcon; -use crate::image::ImageData; +use crate::{color::SyntaxTheme, image::ImageData}; pub fn usize_in_mib(num: usize) -> f32 { num as f32 / 1_024.0 / 1_024.0 @@ -77,3 +85,70 @@ impl From for HoverInfo { } } } + +// TODO(cosmic): Remove after `comrak` supports code block info strings that have a comma +// (like ```rust,ignore) +// https://github.com/kivikakk/comrak/issues/246 +struct CustomSyntectAdapter(SyntectAdapter); + +impl SyntaxHighlighterAdapter for CustomSyntectAdapter { + fn write_highlighted( + &self, + output: &mut dyn io::Write, + lang: Option<&str>, + code: &str, + ) -> io::Result<()> { + let norm_lang = lang.map(|l| l.split_once(',').map(|(lang, _)| lang).unwrap_or(l)); + self.0.write_highlighted(output, norm_lang, code) + } + + fn write_pre_tag( + &self, + output: &mut dyn io::Write, + attributes: HashMap, + ) -> io::Result<()> { + self.0.write_pre_tag(output, attributes) + } + + fn write_code_tag( + &self, + output: &mut dyn io::Write, + attributes: HashMap, + ) -> io::Result<()> { + self.0.write_code_tag(output, attributes) + } +} + +pub fn markdown_to_html(md: &str, syntax_theme: SyntaxTheme) -> String { + let mut options = ComrakOptions::default(); + options.extension.table = true; + options.extension.strikethrough = true; + options.extension.tasklist = true; + options.parse.smart = true; + options.render.unsafe_ = true; + + let theme_set = SyntectThemeSet::load_defaults(); + let syn_set = two_face::syntax::extra(); + let adapter = SyntectAdapterBuilder::new() + .syntax_set(syn_set) + .theme_set(theme_set) + .theme(syntax_theme.as_syntect_name()) + .build(); + + let mut plugins = comrak::ComrakPlugins::default(); + let custom = CustomSyntectAdapter(adapter); + plugins.render.codefence_syntax_highlighter = Some(&custom); + + markdown_to_html_with_plugins(md, &options, &plugins) +} + +// TODO(cosmic): Gonna send a PR upstream because the theme should impl `PartialEq` +pub struct SyntectThemePartialEq<'a>(pub &'a SyntectTheme); + +impl PartialEq for SyntectThemePartialEq<'_> { + fn eq(&self, other: &Self) -> bool { + self.0.name == other.0.name + && self.0.author == other.0.author + && self.0.scopes.len() == other.0.scopes.len() + } +} From bec2fe84f473b6d8a35f360e797ae514e2e23cf3 Mon Sep 17 00:00:00 2001 From: CosmicHorror Date: Sat, 22 Jul 2023 12:45:02 -0600 Subject: [PATCH 12/26] Retry watcher test with increased delays (#155) --- src/watcher/tests.rs | 87 +++++++++++++++++++++++++++++++------------- 1 file changed, 61 insertions(+), 26 deletions(-) diff --git a/src/watcher/tests.rs b/src/watcher/tests.rs index 10fc478c..9bb03bb9 100644 --- a/src/watcher/tests.rs +++ b/src/watcher/tests.rs @@ -12,33 +12,68 @@ impl Callback for mpsc::Sender<()> { } } -const DELAY: Duration = Duration::from_millis(100); -const LONG_TIMEOUT: Duration = Duration::from_millis(2_000); -const SHORT_TIMEOUT: Duration = Duration::from_millis(50); - -fn delay() { - std::thread::sleep(DELAY); -} - fn touch(file: &Path) { let now = filetime::FileTime::now(); filetime::set_file_mtime(file, now).unwrap(); } -#[track_caller] -fn assert_no_message(callback: &mpsc::Receiver<()>) { - assert!(callback.recv_timeout(SHORT_TIMEOUT).is_err()); +#[derive(Clone)] +struct Delays { + delay: Duration, + short_timeout: Duration, + long_timeout: Duration, } -#[track_caller] -fn assert_at_least_one_message(callback: &mpsc::Receiver<()>) { - assert!(callback.recv_timeout(LONG_TIMEOUT).is_ok()); - while callback.recv_timeout(SHORT_TIMEOUT).is_ok() {} +impl Delays { + fn new() -> Self { + Self { + delay: Duration::from_millis(100), + short_timeout: Duration::from_millis(50), + long_timeout: Duration::from_millis(2_000), + } + } + + fn increase_delays(&mut self) { + self.delay *= 2; + self.short_timeout *= 2; + self.long_timeout += Duration::from_millis(1); + } + + fn delay(&self) { + std::thread::sleep(self.delay); + } + + #[track_caller] + fn assert_no_message(&self, callback: &mpsc::Receiver<()>) { + assert!(callback.recv_timeout(self.short_timeout).is_err()); + } + + #[track_caller] + fn assert_at_least_one_message(&self, callback: &mpsc::Receiver<()>) { + assert!(callback.recv_timeout(self.long_timeout).is_ok()); + while callback.recv_timeout(self.short_timeout).is_ok() {} + } } -// Unfortunately this needs to be littered with sleeps/timeouts to work right :/ #[test] fn the_gauntlet() { + // This test can be flaky, so give it a few chances to succeed + let mut last_panic = None; + let mut delays = Delays::new(); + for _ in 0..3 { + let result = std::panic::catch_unwind(|| the_gauntlet_flaky(delays.clone())); + let Err(panic) = result else { + return; + }; + last_panic = Some(panic); + delays.increase_delays(); + } + + std::panic::resume_unwind(last_panic.unwrap()); +} + +// Unfortunately this needs to be littered with sleeps/timeouts to work right :/ +fn the_gauntlet_flaky(delays: Delays) { // Create our dummy test env let temp_dir = tempfile::Builder::new() .prefix("inlyne-tests-") @@ -58,30 +93,30 @@ fn the_gauntlet() { let watcher = Watcher::spawn_inner(callback_tx, main_file.clone()); // Give the watcher time to get comfy :) - delay(); + delays.delay(); // Sanity check watching touch(&main_file); - assert_at_least_one_message(&callback_rx); + delays.assert_at_least_one_message(&callback_rx); // Updating a file follows the new file and not the old one watcher.update_file(&rel_file, fs::read_to_string(&rel_file).unwrap()); - assert_at_least_one_message(&callback_rx); + delays.assert_at_least_one_message(&callback_rx); touch(&main_file); - assert_no_message(&callback_rx); + delays.assert_no_message(&callback_rx); touch(&rel_file); - assert_at_least_one_message(&callback_rx); + delays.assert_at_least_one_message(&callback_rx); // We can slowly swap out the file and it will only follow the file it's supposed to fs::rename(&rel_file, &swapped_out_file).unwrap(); touch(&swapped_out_file); - assert_no_message(&callback_rx); + delays.assert_no_message(&callback_rx); // The "slowly" part of this (give the watcher time to fail and start polling) - delay(); + delays.delay(); fs::rename(&swapped_in_file, &rel_file).unwrap(); - assert_at_least_one_message(&callback_rx); + delays.assert_at_least_one_message(&callback_rx); fs::remove_file(&swapped_out_file).unwrap(); - assert_no_message(&callback_rx); + delays.assert_no_message(&callback_rx); touch(&rel_file); - assert_at_least_one_message(&callback_rx); + delays.assert_at_least_one_message(&callback_rx); } From c01b62692fd28c8c7e76df324c5e0fae0c40fe33 Mon Sep 17 00:00:00 2001 From: CosmicHorror Date: Sat, 22 Jul 2023 12:49:57 -0600 Subject: [PATCH 13/26] Fix-up nested lists (#154) * Add failing tests * Handle nesting of lists * Cleanup list prefix handling --- src/interpreter/mod.rs | 1 + ...terpreter__tests__nested_ordered_list.snap | 72 +++++++++++++++++++ ...ter__tests__ordered_list_in_unordered.snap | 72 +++++++++++++++++++ ...ter__tests__unordered_list_in_ordered.snap | 72 +++++++++++++++++++ src/interpreter/tests.rs | 21 ++++++ 5 files changed, 238 insertions(+) create mode 100644 src/interpreter/snapshots/inlyne__interpreter__tests__nested_ordered_list.snap create mode 100644 src/interpreter/snapshots/inlyne__interpreter__tests__ordered_list_in_unordered.snap create mode 100644 src/interpreter/snapshots/inlyne__interpreter__tests__unordered_list_in_ordered.snap diff --git a/src/interpreter/mod.rs b/src/interpreter/mod.rs index 2fe48b9c..477f96f3 100644 --- a/src/interpreter/mod.rs +++ b/src/interpreter/mod.rs @@ -747,6 +747,7 @@ impl TokenSink for HtmlInterpreter { for element in self.state.element_stack.iter_mut().rev() { if let html::Element::List(html_list) = element { list = Some(html_list); + break; } } let list = list.expect("List ended unexpectedly"); diff --git a/src/interpreter/snapshots/inlyne__interpreter__tests__nested_ordered_list.snap b/src/interpreter/snapshots/inlyne__interpreter__tests__nested_ordered_list.snap new file mode 100644 index 00000000..068e4880 --- /dev/null +++ b/src/interpreter/snapshots/inlyne__interpreter__tests__nested_ordered_list.snap @@ -0,0 +1,72 @@ +--- +source: src/interpreter/tests.rs +description: " --- md\n\n1. 1st outer\n 1. 1st inner\n2. 2nd outer\n\n\n --- html\n\n
    \n
  1. 1st outer\n
      \n
    1. 1st inner
    2. \n
    \n
  2. \n
  3. 2nd outer
  4. \n
\n" +expression: interpret_md(text) +--- +[ + TextBox( + TextBox { + indent: 50.0, + texts: [ + Text { + text: "1. ", + default_color: Color(BLACK), + style: BOLD , + .. + }, + Text { + text: "1st outer", + default_color: Color(BLACK), + .. + }, + Text { + text: " ", + default_color: Color(BLACK), + .. + }, + ], + .. + }, + ), + TextBox( + TextBox { + indent: 100.0, + texts: [ + Text { + text: "1. ", + default_color: Color(BLACK), + style: BOLD , + .. + }, + Text { + text: "1st inner", + default_color: Color(BLACK), + .. + }, + ], + .. + }, + ), + TextBox( + TextBox { + indent: 50.0, + texts: [ + Text { + text: "2. ", + default_color: Color(BLACK), + style: BOLD , + .. + }, + Text { + text: "2nd outer", + default_color: Color(BLACK), + .. + }, + ], + .. + }, + ), + Spacer( + InvisibleSpacer(5), + ), +] diff --git a/src/interpreter/snapshots/inlyne__interpreter__tests__ordered_list_in_unordered.snap b/src/interpreter/snapshots/inlyne__interpreter__tests__ordered_list_in_unordered.snap new file mode 100644 index 00000000..26b81c98 --- /dev/null +++ b/src/interpreter/snapshots/inlyne__interpreter__tests__ordered_list_in_unordered.snap @@ -0,0 +1,72 @@ +--- +source: src/interpreter/tests.rs +description: " --- md\n\n- bullet\n 1. 1st inner\n- bullet\n\n\n --- html\n\n
    \n
  • bullet\n
      \n
    1. 1st inner
    2. \n
    \n
  • \n
  • bullet
  • \n
\n" +expression: interpret_md(text) +--- +[ + TextBox( + TextBox { + indent: 50.0, + texts: [ + Text { + text: "· ", + default_color: Color(BLACK), + style: BOLD , + .. + }, + Text { + text: "bullet", + default_color: Color(BLACK), + .. + }, + Text { + text: " ", + default_color: Color(BLACK), + .. + }, + ], + .. + }, + ), + TextBox( + TextBox { + indent: 100.0, + texts: [ + Text { + text: "1. ", + default_color: Color(BLACK), + style: BOLD , + .. + }, + Text { + text: "1st inner", + default_color: Color(BLACK), + .. + }, + ], + .. + }, + ), + TextBox( + TextBox { + indent: 50.0, + texts: [ + Text { + text: "· ", + default_color: Color(BLACK), + style: BOLD , + .. + }, + Text { + text: "bullet", + default_color: Color(BLACK), + .. + }, + ], + .. + }, + ), + Spacer( + InvisibleSpacer(5), + ), +] diff --git a/src/interpreter/snapshots/inlyne__interpreter__tests__unordered_list_in_ordered.snap b/src/interpreter/snapshots/inlyne__interpreter__tests__unordered_list_in_ordered.snap new file mode 100644 index 00000000..fa68bd09 --- /dev/null +++ b/src/interpreter/snapshots/inlyne__interpreter__tests__unordered_list_in_ordered.snap @@ -0,0 +1,72 @@ +--- +source: src/interpreter/tests.rs +description: " --- md\n\n1. 1st outer\n - bullet\n2. 2nd outer\n\n\n --- html\n\n
    \n
  1. 1st outer\n
      \n
    • bullet
    • \n
    \n
  2. \n
  3. 2nd outer
  4. \n
\n" +expression: interpret_md(text) +--- +[ + TextBox( + TextBox { + indent: 50.0, + texts: [ + Text { + text: "1. ", + default_color: Color(BLACK), + style: BOLD , + .. + }, + Text { + text: "1st outer", + default_color: Color(BLACK), + .. + }, + Text { + text: " ", + default_color: Color(BLACK), + .. + }, + ], + .. + }, + ), + TextBox( + TextBox { + indent: 100.0, + texts: [ + Text { + text: "· ", + default_color: Color(BLACK), + style: BOLD , + .. + }, + Text { + text: "bullet", + default_color: Color(BLACK), + .. + }, + ], + .. + }, + ), + TextBox( + TextBox { + indent: 50.0, + texts: [ + Text { + text: "2. ", + default_color: Color(BLACK), + style: BOLD , + .. + }, + Text { + text: "2nd outer", + default_color: Color(BLACK), + .. + }, + ], + .. + }, + ), + Spacer( + InvisibleSpacer(5), + ), +] diff --git a/src/interpreter/tests.rs b/src/interpreter/tests.rs index 3e01b5da..012641cd 100644 --- a/src/interpreter/tests.rs +++ b/src/interpreter/tests.rs @@ -141,11 +141,32 @@ let v = 1; ``` "; +const UNORDERED_LIST_IN_ORDERED: &str = "\ +1. 1st outer + - bullet +2. 2nd outer +"; + +const NESTED_ORDERED_LIST: &str = "\ +1. 1st outer + 1. 1st inner +2. 2nd outer +"; + +const ORDERED_LIST_IN_UNORDERED: &str = "\ +- bullet + 1. 1st inner +- bullet +"; + snapshot_interpreted_elements!( (sanity, SANITY), (checklist_has_no_text_prefix, CHECKLIST_HAS_NO_TEXT_PREFIX), (toml_gets_highlighted, TOML_GETS_HIGHLIGHTED), (handles_comma_in_info_str, HANDLES_COMMA_IN_INFO_STR), + (unordered_list_in_ordered, UNORDERED_LIST_IN_ORDERED), + (nested_ordered_list, NESTED_ORDERED_LIST), + (ordered_list_in_unordered, ORDERED_LIST_IN_UNORDERED), ); /// Spin up a server, so we can test network requests without external services From 87e458688b036c1903a8aa670acaa32d859b543f Mon Sep 17 00:00:00 2001 From: CosmicHorror Date: Sun, 23 Jul 2023 17:59:26 -0600 Subject: [PATCH 14/26] Dogfood new `smart-debug` crate (#156) --- Cargo.lock | 57 +++++++++++++++++--------- Cargo.toml | 4 +- src/debug_impls.rs | 99 +++++++--------------------------------------- src/image/mod.rs | 37 +++++++++-------- src/text.rs | 27 +++++++------ 5 files changed, 88 insertions(+), 136 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c50f6400..43b6a5d9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -265,7 +265,7 @@ checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", ] [[package]] @@ -282,7 +282,7 @@ checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", ] [[package]] @@ -438,7 +438,7 @@ checksum = "fdde5c9cd29ebd706ce1b35600920a33550e402fc998a2e53ad3b42c3c47a192" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", ] [[package]] @@ -1013,7 +1013,7 @@ checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", ] [[package]] @@ -1353,7 +1353,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", ] [[package]] @@ -1825,6 +1825,7 @@ dependencies = [ "reqwest", "resvg", "serde", + "smart-debug", "syntect", "tempfile", "tiny-skia 0.9.0", @@ -2633,7 +2634,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", ] [[package]] @@ -2953,9 +2954,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.56" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] @@ -2986,9 +2987,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.27" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f4f29d145265ec1c483c7c654450edde0bfe043d3938d6972630663356d9500" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -3424,7 +3425,7 @@ checksum = "a2a0814352fd64b58489904a44ea8d90cb1a91dcb6b4f5ebabc32c8318e93cb6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", ] [[package]] @@ -3457,7 +3458,7 @@ checksum = "bcec881020c684085e55a25f7fd888954d56609ef363479dc5a1305eb0d40cab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", ] [[package]] @@ -3552,6 +3553,26 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +[[package]] +name = "smart-debug" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5502c61a245a5ded27cb2e4a49cac93b3527d0653ca517769aaa96138ff3241" +dependencies = [ + "smart-debug-derive", +] + +[[package]] +name = "smart-debug-derive" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34e5f490c4650ac837987490484f6b105ea9d317a93083a0f94f4de3ffc7b1ba" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + [[package]] name = "smithay-client-toolkit" version = "0.16.0" @@ -3690,9 +3711,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.15" +version = "2.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" dependencies = [ "proc-macro2", "quote", @@ -3772,7 +3793,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", ] [[package]] @@ -3979,7 +4000,7 @@ checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", ] [[package]] @@ -4288,7 +4309,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", "wasm-bindgen-shared", ] @@ -4322,7 +4343,7 @@ checksum = "4783ce29f09b9d93134d41297aded3a712b7b979e9c6f28c32cb88c973a94869" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", "wasm-bindgen-backend", "wasm-bindgen-shared", ] diff --git a/Cargo.toml b/Cargo.toml index 54fa9e74..7ac2b690 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,11 +40,9 @@ dark-light = "1.0.0" # `checked-decode` lz4_flex = { version = "0.10.0", default-features = false, features = ["frame", "safe-encode", "std"] } pollster = "0.3.0" +smart-debug = "0.0.2" syntect = "5.1.0" -[profile.release] -strip = true - [dependencies.two-face] version = "0.1.1" default-features = false diff --git a/src/debug_impls.rs b/src/debug_impls.rs index ec4d7bf0..c4636a94 100644 --- a/src/debug_impls.rs +++ b/src/debug_impls.rs @@ -4,11 +4,18 @@ use std::fmt; -use crate::{ - positioner::Spacer, - text::{Text, TextBox}, - Image, -}; +use crate::{positioner::Spacer, text::Text}; + +pub struct DebugInlineMaybeF32Color<'a>(pub &'a Option<[f32; 4]>); + +impl fmt::Debug for DebugInlineMaybeF32Color<'_> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self.0 { + None => f.write_str("None"), + Some(rgba) => f.write_fmt(format_args!("Some({:?})", DebugF32Color(*rgba))), + } + } +} pub struct DebugF32Color(pub [f32; 4]); @@ -30,9 +37,9 @@ impl fmt::Debug for DebugF32Color { } } -struct DebugInline<'inner, T>(&'inner T); +pub struct DebugInline<'inner, T>(pub &'inner T); -impl<'inner, T: fmt::Debug> fmt::Debug for DebugInline<'inner, T> { +impl fmt::Debug for DebugInline<'_, T> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_fmt(format_args!("{:?}", self.0)) } @@ -48,7 +55,7 @@ fn debug_inline_some( } } -struct DebugBytesPrefix<'a>(&'a [u8]); +pub struct DebugBytesPrefix<'a>(pub &'a [u8]); impl<'a> fmt::Debug for DebugBytesPrefix<'a> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { @@ -62,49 +69,6 @@ impl<'a> fmt::Debug for DebugBytesPrefix<'a> { } } -pub fn text_box(text_box: &TextBox, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let TextBox { - indent, - texts, - is_code_block, - is_quote_block, - is_checkbox, - is_anchor, - align, - // Globally consistent so avoid displaying as noise - hidpi_scale: _, - padding_height, - background_color, - } = text_box; - - let mut debug = f.debug_struct("TextBox"); - - let default = TextBox::default(); - - if align != &default.align { - debug.field("align", align); - } - if *indent != default.indent { - debug.field("indent", indent); - } - if *padding_height != default.padding_height { - debug.field("padding_height", padding_height); - } - let background_color = background_color.map(DebugF32Color); - debug_inline_some(&mut debug, "background_color", &background_color); - if *is_code_block { - debug.field("is_code_block", &is_code_block); - } - debug_inline_some(&mut debug, "is_quote_block", is_quote_block); - debug_inline_some(&mut debug, "is_checkbox", is_checkbox); - debug_inline_some(&mut debug, "is_anchor", is_anchor); - - // Texts at the end so all the smaller fields for text box are easily visible - debug.field("texts", texts); - - debug.finish_non_exhaustive() -} - pub fn text(text: &Text, f: &mut fmt::Formatter<'_>) -> fmt::Result { #[derive(Copy, Clone)] struct StyleWrapper { @@ -210,36 +174,3 @@ pub fn spacer(spacer: &Spacer, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_fmt(format_args!("InvisibleSpacer({space})")) } } - -pub fn image(image: &Image, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let Image { - image_data, - is_aligned, - size, - bind_group: _, - is_link, - hidpi_scale: _, - } = image; - - let mut debug = f.debug_struct("Image"); - - debug.field("image_data", image_data); - debug_inline_some(&mut debug, "is_aligned", is_aligned); - debug_inline_some(&mut debug, "size", size); - debug_inline_some(&mut debug, "is_link", is_link); - - debug.finish_non_exhaustive() -} - -pub fn image_data( - (lz4_blob, scale, dimensions): (&[u8], &bool, &(u32, u32)), - f: &mut fmt::Formatter<'_>, -) -> fmt::Result { - let mut debug = f.debug_struct("ImageData"); - - debug.field("lz4_blob", &DebugBytesPrefix(lz4_blob)); - debug.field("scale", scale); - debug.field("dimensions", &DebugInline(dimensions)); - - debug.finish() -} diff --git a/src/image/mod.rs b/src/image/mod.rs index 6e7e7249..cd5e15fc 100644 --- a/src/image/mod.rs +++ b/src/image/mod.rs @@ -1,11 +1,11 @@ -use crate::debug_impls; +use crate::debug_impls::{DebugBytesPrefix, DebugInline}; use crate::interpreter::ImageCallback; use crate::positioner::DEFAULT_MARGIN; use crate::utils::{usize_in_mib, Align, Point, Size}; use anyhow::Context; use bytemuck::{Pod, Zeroable}; use image::{ImageBuffer, RgbaImage}; -use std::fmt; +use smart_debug::SmartDebug; use std::fs; use std::io; use std::path::PathBuf; @@ -27,24 +27,15 @@ pub enum ImageSize { PxHeight(u32), } -#[derive(Default, Clone)] +#[derive(SmartDebug, Default, Clone)] pub struct ImageData { + #[debug(wrapper = DebugBytesPrefix)] lz4_blob: Vec, scale: bool, + #[debug(wrapper = DebugInline)] dimensions: (u32, u32), } -impl fmt::Debug for ImageData { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let Self { - lz4_blob, - scale, - dimensions, - } = self; - debug_impls::image_data((lz4_blob, scale, dimensions), f) - } -} - impl ImageData { fn load(bytes: &[u8], scale: bool) -> anyhow::Result { let (lz4_blob, dimensions) = decode::decode_and_compress(bytes)?; @@ -86,20 +77,28 @@ impl ImageData { } } -#[derive(Default)] +#[derive(SmartDebug, Default)] pub struct Image { + #[debug(ignore_fn = debug_ignore_image_data)] pub image_data: Arc>>, + #[debug(ignore_fn = Option::is_none, wrapper = DebugInline)] pub is_aligned: Option, + #[debug(ignore_fn = Option::is_none, wrapper = DebugInline)] pub size: Option, + #[debug(ignore)] pub bind_group: Option>, + #[debug(ignore_fn = Option::is_none, wrapper = DebugInline)] pub is_link: Option, + #[debug(ignore)] pub hidpi_scale: f32, } -impl fmt::Debug for Image { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - debug_impls::image(self, f) - } +fn debug_ignore_image_data(mutex: &Mutex>) -> bool { + let data = match mutex.lock() { + Ok(data) => data, + Err(poison_error) => poison_error.into_inner(), + }; + data.is_none() } impl Image { diff --git a/src/text.rs b/src/text.rs index 1f71f478..b412c9fd 100644 --- a/src/text.rs +++ b/src/text.rs @@ -1,31 +1,34 @@ use std::fmt; -use crate::debug_impls; +use crate::debug_impls::{self, DebugInline, DebugInlineMaybeF32Color}; use crate::utils::{Align, Line, Point, Rect, Selection, Size}; +use smart_debug::SmartDebug; + use wgpu_glyph::{ ab_glyph::{Font, FontArc, PxScale}, Extra, FontId, GlyphCruncher, HorizontalAlign, Layout, Section, SectionGlyph, }; -#[derive(Clone)] +#[derive(SmartDebug, Clone)] +#[debug(ignore_defaults)] pub struct TextBox { + pub align: Align, pub indent: f32, - pub texts: Vec, + pub padding_height: f32, + #[debug(wrapper = DebugInlineMaybeF32Color)] + pub background_color: Option<[f32; 4]>, pub is_code_block: bool, + #[debug(wrapper = DebugInline)] pub is_quote_block: Option, + #[debug(wrapper = DebugInline)] pub is_checkbox: Option, + #[debug(wrapper = DebugInline)] pub is_anchor: Option, - pub align: Align, + #[debug(no_ignore)] + pub texts: Vec, + #[debug(ignore)] pub hidpi_scale: f32, - pub padding_height: f32, - pub background_color: Option<[f32; 4]>, -} - -impl fmt::Debug for TextBox { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - debug_impls::text_box(self, f) - } } impl Default for TextBox { From 326c8a2d919bbe82699f8e556195575282e1781d Mon Sep 17 00:00:00 2001 From: CosmicHorror Date: Wed, 1 Nov 2023 12:01:21 -0600 Subject: [PATCH 15/26] Dont ignore locked mutex in debug impl (#166) --- src/image/mod.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/image/mod.rs b/src/image/mod.rs index cd5e15fc..bdd3b13c 100644 --- a/src/image/mod.rs +++ b/src/image/mod.rs @@ -94,11 +94,10 @@ pub struct Image { } fn debug_ignore_image_data(mutex: &Mutex>) -> bool { - let data = match mutex.lock() { - Ok(data) => data, - Err(poison_error) => poison_error.into_inner(), - }; - data.is_none() + match mutex.lock() { + Ok(data) => data.is_none(), + Err(_) => true, + } } impl Image { From 4a339862d632ff693c67824fa3e3732413628bf0 Mon Sep 17 00:00:00 2001 From: AlphaKeks <85143381+AlphaKeks@users.noreply.github.com> Date: Fri, 10 Nov 2023 19:15:25 +0100 Subject: [PATCH 16/26] fix: add missing `fontdb` feature flag (#169) This solves an issue with the NixOS build where fonts are required at runtime for inlyne to start. With the `fontconfig` feature flag inlyne will use font-config to determine a font. Partially resolves #164 --- Cargo.lock | 1 + Cargo.toml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 43b6a5d9..dd4f679e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1811,6 +1811,7 @@ dependencies = [ "env_logger", "filetime", "font-kit", + "fontdb", "html5ever", "image", "insta", diff --git a/Cargo.toml b/Cargo.toml index 7ac2b690..7acfce08 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,6 +43,9 @@ pollster = "0.3.0" smart-debug = "0.0.2" syntect = "5.1.0" +# Required for WGPU to work properly with Vulkan +fontdb = { version = "0.13.1", features = ["fontconfig"] } + [dependencies.two-face] version = "0.1.1" default-features = false From 33220acb4e83376a7e71b27d2180f4a76c5e3283 Mon Sep 17 00:00:00 2001 From: CosmicHorror Date: Sun, 19 Nov 2023 16:13:02 -0700 Subject: [PATCH 17/26] Add relevant keywords to `Cargo.toml` (#171) --- Cargo.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 7acfce08..5ac18720 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,6 +8,8 @@ license = "MIT" readme = "README.md" repository = "https://github.com/trimental/inlyne" homepage = "https://github.com/trimental/inlyne" +rust-version = "1.65" +keywords = ["markdown", "viewer", "gpu"] [dependencies] wgpu_glyph = "0.20" From d63d4835e9e3046fd8573fa3e08ef5133e469c22 Mon Sep 17 00:00:00 2001 From: CosmicHorror Date: Sun, 19 Nov 2023 16:26:22 -0700 Subject: [PATCH 18/26] Use `human-panic` for a custom panic hook (#172) * Use `human-panic` for a custom panic hook * Indicate that the version is a "git release" --- Cargo.lock | 141 +++++++++++++++++++++++++++++++++++++++++++++------- Cargo.toml | 3 +- src/main.rs | 2 + 3 files changed, 128 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dd4f679e..8b738148 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -95,12 +95,26 @@ dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", - "anstyle-wincon", + "anstyle-wincon 1.0.1", "colorchoice", "is-terminal", "utf8parse", ] +[[package]] +name = "anstream" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon 3.0.1", + "colorchoice", + "utf8parse", +] + [[package]] name = "anstyle" version = "1.0.0" @@ -135,6 +149,16 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "anstyle-wincon" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +dependencies = [ + "anstyle", + "windows-sys 0.48.0", +] + [[package]] name = "anyhow" version = "1.0.71" @@ -502,7 +526,7 @@ version = "4.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "914c8c79fb560f238ef6429439a30023c862f7a28e688c58f7203f12b29970bd" dependencies = [ - "anstream", + "anstream 0.3.2", "anstyle", "bitflags 1.3.2", "clap_lex", @@ -1029,6 +1053,12 @@ dependencies = [ "termcolor", ] +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "errno" version = "0.3.1" @@ -1542,7 +1572,7 @@ checksum = "0b0c02e1ba0bdb14e965058ca34e09c020f8e507a760df1121728e0aef68d57a" dependencies = [ "bitflags 1.3.2", "gpu-descriptor-types", - "hashbrown", + "hashbrown 0.12.3", ] [[package]] @@ -1566,7 +1596,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap", + "indexmap 1.9.3", "slab", "tokio", "tokio-util", @@ -1591,6 +1621,12 @@ dependencies = [ "ahash", ] +[[package]] +name = "hashbrown" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" + [[package]] name = "hassle-rs" version = "0.10.0" @@ -1702,6 +1738,22 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +[[package]] +name = "human-panic" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a79a67745be0cb8dd2771f03b24c2f25df98d5471fe7a595d668cfa2e6f843d" +dependencies = [ + "anstream 0.6.4", + "anstyle", + "backtrace", + "os_info", + "serde", + "serde_derive", + "toml 0.8.8", + "uuid", +] + [[package]] name = "humantime" version = "2.1.0" @@ -1787,7 +1839,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +dependencies = [ + "equivalent", + "hashbrown 0.14.2", ] [[package]] @@ -1798,7 +1860,7 @@ checksum = "64e9829a50b42bb782c1df523f78d332fe371b10c661e78b7a3c34b0198e9fac" [[package]] name = "inlyne" -version = "0.3.1" +version = "0.3.2-alpha" dependencies = [ "anyhow", "bytemuck", @@ -1813,6 +1875,7 @@ dependencies = [ "font-kit", "fontdb", "html5ever", + "human-panic", "image", "insta", "log", @@ -1830,7 +1893,7 @@ dependencies = [ "syntect", "tempfile", "tiny-skia 0.9.0", - "toml", + "toml 0.7.3", "two-face", "usvg", "wgpu", @@ -2300,7 +2363,7 @@ dependencies = [ "bitflags 1.3.2", "codespan-reporting", "hexf-parse", - "indexmap", + "indexmap 1.9.3", "log", "num-traits", "rustc-hash", @@ -2687,7 +2750,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccd746e37177e1711c20dd619a1620f34f5c8b569c53590a72dedd5344d8924a" dependencies = [ "dlv-list", - "hashbrown", + "hashbrown 0.12.3", ] [[package]] @@ -2700,6 +2763,17 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "os_info" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "006e42d5b888366f1880eda20371fedde764ed2213dc8496f49622fa0c99cd5e" +dependencies = [ + "log", + "serde", + "winapi", +] + [[package]] name = "output_vt100" version = "0.1.3" @@ -2877,7 +2951,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bd9647b268a3d3e14ff09c23201133a62589c658db02bb7388c7246aafe0590" dependencies = [ "base64 0.21.0", - "indexmap", + "indexmap 1.9.3", "line-wrap", "quick-xml", "serde", @@ -2950,7 +3024,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", - "toml_edit", + "toml_edit 0.19.8", ] [[package]] @@ -3464,9 +3538,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.1" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0efd8caf556a6cebd3b285caf480045fcc1ac04f6bd786b09a6f11af30c4fcf4" +checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" dependencies = [ "serde", ] @@ -3950,14 +4024,26 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit", + "toml_edit 0.19.8", +] + +[[package]] +name = "toml" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.21.0", ] [[package]] name = "toml_datetime" -version = "0.6.1" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" dependencies = [ "serde", ] @@ -3968,13 +4054,25 @@ version = "0.19.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "239410c8609e8125456927e6707163a3b1fdb40561e4b803bc041f466ccfdc13" dependencies = [ - "indexmap", + "indexmap 1.9.3", "serde", "serde_spanned", "toml_datetime", "winnow", ] +[[package]] +name = "toml_edit" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +dependencies = [ + "indexmap 2.1.0", + "serde", + "serde_spanned", + "toml_datetime", +] + [[package]] name = "tower-service" version = "0.3.2" @@ -4233,6 +4331,15 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +[[package]] +name = "uuid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc" +dependencies = [ + "getrandom 0.2.9", +] + [[package]] name = "vcpkg" version = "0.2.15" diff --git a/Cargo.toml b/Cargo.toml index 5ac18720..f55a23c6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "inlyne" -version = "0.3.1" +version = "0.3.2-alpha" description = "Introducing Inlyne, a GPU powered yet browserless tool to help you quickly view markdown files in the blink of an eye." edition = "2021" authors = ["trimental"] @@ -47,6 +47,7 @@ syntect = "5.1.0" # Required for WGPU to work properly with Vulkan fontdb = { version = "0.13.1", features = ["fontconfig"] } +human-panic = "1.2.2" [dependencies.two-face] version = "0.1.1" diff --git a/src/main.rs b/src/main.rs index 17bba6f0..e17570dd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -736,6 +736,8 @@ impl Inlyne { } fn main() -> anyhow::Result<()> { + human_panic::setup_panic!(); + env_logger::Builder::new() .filter_level(log::LevelFilter::Error) .filter_module("inlyne", log::LevelFilter::Info) From a468ad8639a2dc694d8d1c35250a3fcc4b2170e7 Mon Sep 17 00:00:00 2001 From: Cosmic Horror Date: Wed, 22 Nov 2023 22:06:28 -0700 Subject: [PATCH 19/26] `cargo upgragde` --- Cargo.lock | 869 +++++++++++++++++++++++++++-------------------------- Cargo.toml | 36 +-- 2 files changed, 465 insertions(+), 440 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8b738148..5888c06a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "ab_glyph" -version = "0.2.21" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5110f1c78cf582855d895ecd0746b653db010cec6d9f5575293f27934d980a39" +checksum = "80179d7dd5d7e8c285d67c4a1e652972a92de7475beddfb92028c76463b13225" dependencies = [ "ab_glyph_rasterizer", "owned_ttf_parser", @@ -35,29 +35,29 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" dependencies = [ - "getrandom 0.2.9", + "getrandom 0.2.11", "once_cell", "version_check", ] [[package]] name = "aho-corasick" -version = "1.0.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] [[package]] name = "android-activity" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c77a0045eda8b888c76ea473c2b0515ba6f471d318f8927c5c72240937035a6" +checksum = "40bc1575e653f158cbdc6ebcd917b9564e66321c5325c232c3591269c257be69" dependencies = [ "android-properties", "bitflags 1.3.2", @@ -68,7 +68,7 @@ dependencies = [ "ndk", "ndk-context", "ndk-sys", - "num_enum", + "num_enum 0.6.1", ] [[package]] @@ -86,21 +86,6 @@ dependencies = [ "libc", ] -[[package]] -name = "anstream" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon 1.0.1", - "colorchoice", - "is-terminal", - "utf8parse", -] - [[package]] name = "anstream" version = "0.6.4" @@ -110,22 +95,22 @@ dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", - "anstyle-wincon 3.0.1", + "anstyle-wincon", "colorchoice", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.0" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" +checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anstyle-parse" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e765fd216e48e067936442276d1d57399e37bce53c264d6fefbe298080cb57ee" +checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" dependencies = [ "utf8parse", ] @@ -139,16 +124,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "anstyle-wincon" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" -dependencies = [ - "anstyle", - "windows-sys 0.48.0", -] - [[package]] name = "anstyle-wincon" version = "3.0.1" @@ -161,9 +136,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "approx" @@ -182,9 +157,9 @@ checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" [[package]] name = "arrayvec" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "ash" @@ -217,9 +192,9 @@ dependencies = [ [[package]] name = "async-channel" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf46fee83e5ccffc220104713af3292ff9bc7c64c7de289f66dae8e38d826833" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" dependencies = [ "concurrent-queue", "event-listener", @@ -235,7 +210,7 @@ dependencies = [ "async-lock", "async-task", "concurrent-queue", - "fastrand", + "fastrand 1.9.0", "futures-lite", "slab", ] @@ -266,9 +241,9 @@ dependencies = [ "log", "parking", "polling", - "rustix", + "rustix 0.37.25", "slab", - "socket2", + "socket2 0.4.9", "waker-fn", ] @@ -300,9 +275,9 @@ checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" [[package]] name = "async-trait" -version = "0.1.68" +version = "0.1.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", @@ -344,9 +319,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.0" +version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" [[package]] name = "bincode" @@ -386,9 +361,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.2.1" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24a6904aef64d73cf10ab17ebace7befb918b82164785cb89907993be7f83813" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" [[package]] name = "block" @@ -434,31 +409,31 @@ dependencies = [ "async-lock", "async-task", "atomic-waker", - "fastrand", + "fastrand 1.9.0", "futures-lite", "log", ] [[package]] name = "bumpalo" -version = "3.12.2" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c6ed94e98ecff0c12dd1b04c15ec0d7d9458ca8fe806cea6f12954efe74c63b" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "bytemuck" -version = "1.13.1" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" +checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdde5c9cd29ebd706ce1b35600920a33550e402fc998a2e53ad3b42c3c47a192" +checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" dependencies = [ "proc-macro2", "quote", @@ -467,22 +442,23 @@ dependencies = [ [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "calloop" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a59225be45a478d772ce015d9743e49e92798ece9e34eda9a6aa2a6a7f40192" +checksum = "52e0d00eb1ea24371a97d2da6201c6747a633dc6dc1988ef503403b4c59504a8" dependencies = [ + "bitflags 1.3.2", "log", "nix 0.25.1", "slotmap", @@ -492,11 +468,12 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.79" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ "jobserver", + "libc", ] [[package]] @@ -513,41 +490,39 @@ checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" [[package]] name = "clap" -version = "4.2.7" +version = "4.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34d21f9bf1b425d2968943631ec91202fe5e837264063503708b83013f8fc938" +checksum = "2275f18819641850fa26c89acc84d465c1bf91ce57bc2748b28c420473352f64" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.2.7" +version = "4.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "914c8c79fb560f238ef6429439a30023c862f7a28e688c58f7203f12b29970bd" +checksum = "07cdf1b148b25c1e1f7a42225e30a0d99a615cd4637eae7365548dd4529b95bc" dependencies = [ - "anstream 0.3.2", + "anstream", "anstyle", - "bitflags 1.3.2", "clap_lex", - "once_cell", "strsim", ] [[package]] name = "clap_complete" -version = "4.2.2" +version = "4.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36774babb166352bb4f7b9cb16f781ffa3439d2a8f12cd31bea85a38c888fea3" +checksum = "bffe91f06a11b4b9420f62103854e90867812cd5d01557f853c5ee8e791b12ae" dependencies = [ "clap", ] [[package]] name = "clap_lex" -version = "0.4.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" [[package]] name = "clipboard-win" @@ -684,13 +659,12 @@ dependencies = [ [[package]] name = "core-graphics-types" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" +checksum = "2bb142d41022986c1d8ff29103a1411c8a3dfad3552f87a4f8dc50d61d4f4e33" dependencies = [ "bitflags 1.3.2", "core-foundation", - "foreign-types", "libc", ] @@ -747,22 +721,22 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.14" +version = "0.9.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695" +checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", - "memoffset 0.8.0", + "memoffset 0.9.0", "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.15" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" dependencies = [ "cfg-if", ] @@ -783,16 +757,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "ctor" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" -dependencies = [ - "quote", - "syn 1.0.109", -] - [[package]] name = "d3d12" version = "0.6.0" @@ -816,7 +780,7 @@ dependencies = [ "objc", "rust-ini", "web-sys", - "winreg", + "winreg 0.10.1", "zbus", "zvariant", ] @@ -961,11 +925,11 @@ checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" [[package]] name = "dlib" -version = "0.5.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1b7517328c04c2aa68422fc60a41b92208182142ed04a25879c26c8f878794" +checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "libloading 0.7.4", + "libloading 0.8.0", ] [[package]] @@ -994,9 +958,9 @@ dependencies = [ [[package]] name = "either" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "encode_unicode" @@ -1006,9 +970,9 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" -version = "0.8.32" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ "cfg-if", ] @@ -1042,9 +1006,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +checksum = "95b3f3e67048839cb0d0781f445682a35113da7121f7c949db0e2be96a4fbece" dependencies = [ "humantime", "is-terminal", @@ -1061,25 +1025,14 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.1" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +checksum = "7c18ee0ed65a5f1f81cac6b1d213b69c35fa47d4252ad41f1486dbd8226fe36e" dependencies = [ - "errno-dragonfly", "libc", "windows-sys 0.48.0", ] -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] - [[package]] name = "euclid" version = "0.22.9" @@ -1097,15 +1050,15 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "exr" -version = "1.6.3" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdd2162b720141a91a054640662d3edce3d50a944a50ffca5313cd951abb35b4" +checksum = "d1e481eb11a482815d3e9d618db8c42a93207134662873809335a92327440c18" dependencies = [ "bit_field", "flume", "half", "lebe", - "miniz_oxide 0.6.2", + "miniz_oxide 0.7.1", "rayon-core", "smallvec", "zune-inflate", @@ -1130,32 +1083,38 @@ dependencies = [ "instant", ] +[[package]] +name = "fastrand" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" + [[package]] name = "fdeflate" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d329bdeac514ee06249dabc27877490f17f5d371ec693360768b838e19f3ae10" +checksum = "64d6dafc854908ff5da46ff3f8f473c6984119a2876a383a860246dd7841a868" dependencies = [ "simd-adler32", ] [[package]] name = "filetime" -version = "0.2.21" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cbc844cecaee9d4443931972e1289c8ff485cb4cc2767cb03ca139ed6885153" +checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.2.16", + "redox_syscall 0.3.5", "windows-sys 0.48.0", ] [[package]] name = "flate2" -version = "1.0.26" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", "miniz_oxide 0.7.1", @@ -1265,9 +1224,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" dependencies = [ "percent-encoding", ] @@ -1339,9 +1298,9 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" [[package]] name = "futures-executor" @@ -1356,9 +1315,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" [[package]] name = "futures-lite" @@ -1366,7 +1325,7 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" dependencies = [ - "fastrand", + "fastrand 1.9.0", "futures-core", "futures-io", "memchr", @@ -1388,15 +1347,15 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" [[package]] name = "futures-timer" @@ -1455,9 +1414,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if", "js-sys", @@ -1586,9 +1545,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.18" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f8a914c2987b688368b5138aa05321db91f4090cf26118185672ad588bce21" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" dependencies = [ "bytes", "fnv", @@ -1644,18 +1603,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "hex" @@ -1685,9 +1635,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ "bytes", "fnv", @@ -1734,9 +1684,9 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "human-panic" @@ -1744,7 +1694,7 @@ version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a79a67745be0cb8dd2771f03b24c2f25df98d5471fe7a595d668cfa2e6f843d" dependencies = [ - "anstream 0.6.4", + "anstream", "anstyle", "backtrace", "os_info", @@ -1762,9 +1712,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.26" +version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ "bytes", "futures-channel", @@ -1777,7 +1727,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.4.9", "tokio", "tower-service", "tracing", @@ -1799,9 +1749,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -1809,9 +1759,9 @@ dependencies = [ [[package]] name = "image" -version = "0.24.6" +version = "0.24.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "527909aa81e20ac3a44803521443a765550f09b5130c2c2fa1ea59c2f8f50a3a" +checksum = "6f3dfdbdd72063086ff443e297b61695500514b1e41095b6fb9a5ab48a70a711" dependencies = [ "bytemuck", "byteorder", @@ -1892,8 +1842,8 @@ dependencies = [ "smart-debug", "syntect", "tempfile", - "tiny-skia 0.9.0", - "toml 0.7.3", + "tiny-skia 0.9.1", + "toml 0.7.8", "two-face", "usvg", "wgpu", @@ -1949,20 +1899,20 @@ dependencies = [ [[package]] name = "io-lifetimes" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi 0.3.1", + "hermit-abi", "libc", "windows-sys 0.48.0", ] [[package]] name = "ipnet" -version = "2.7.2" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" +checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" [[package]] name = "is-docker" @@ -1975,13 +1925,12 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "hermit-abi 0.3.1", - "io-lifetimes", - "rustix", + "hermit-abi", + "rustix 0.38.25", "windows-sys 0.48.0", ] @@ -1997,9 +1946,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.6" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "jni-sys" @@ -2009,9 +1958,9 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "jobserver" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" dependencies = [ "libc", ] @@ -2027,9 +1976,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.62" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68c16e1bfd491478ab155fd8b4896b86f9ede344949b641e61501e07c2b8b4d5" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" dependencies = [ "wasm-bindgen", ] @@ -2094,9 +2043,9 @@ checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" [[package]] name = "libc" -version = "0.2.144" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "libloading" @@ -2120,9 +2069,9 @@ dependencies = [ [[package]] name = "libm" -version = "0.2.6" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "line-wrap" @@ -2141,15 +2090,21 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.3.7" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "linux-raw-sys" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ece97ea872ece730aed82664c424eb4c8291e1ff2480247ccf7409044bc6479f" +checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" [[package]] name = "lock_api" -version = "0.4.9" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -2157,12 +2112,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "lyon" @@ -2256,9 +2208,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "memmap2" @@ -2289,9 +2241,9 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" dependencies = [ "autocfg", ] @@ -2343,14 +2295,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.6" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" +checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -2379,7 +2331,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" dependencies = [ - "getrandom 0.2.9", + "getrandom 0.2.11", ] [[package]] @@ -2409,7 +2361,7 @@ dependencies = [ "bitflags 1.3.2", "jni-sys", "ndk-sys", - "num_enum", + "num_enum 0.5.11", "raw-window-handle", "thiserror", ] @@ -2485,9 +2437,9 @@ dependencies = [ [[package]] name = "notify" -version = "5.1.0" +version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58ea850aa68a06e48fdb069c0ec44d0d64c8dbffa49bf3b6f7f0a901fdea1ba9" +checksum = "729f63e1ca555a43fe3efa4f3efdf4801c479da85b432242a7b726f353c88486" dependencies = [ "bitflags 1.3.2", "crossbeam-channel", @@ -2498,7 +2450,7 @@ dependencies = [ "libc", "mio", "walkdir", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] @@ -2524,9 +2476,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", "libm", @@ -2534,11 +2486,11 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.2.6", + "hermit-abi", "libc", ] @@ -2548,7 +2500,16 @@ version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" dependencies = [ - "num_enum_derive", + "num_enum_derive 0.5.11", +] + +[[package]] +name = "num_enum" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" +dependencies = [ + "num_enum_derive 0.6.1", ] [[package]] @@ -2563,6 +2524,18 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "num_enum_derive" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.39", +] + [[package]] name = "objc" version = "0.2.7" @@ -2639,9 +2612,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.17.1" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "onig" @@ -2667,19 +2640,20 @@ dependencies = [ [[package]] name = "open" -version = "4.1.0" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16814a067484415fda653868c9be0ac5f2abd2ef5d951082a5f2fe1b3662944" +checksum = "3a083c0c7e5e4a8ec4176346cf61f67ac674e8bfb059d9226e1c54a96b377c12" dependencies = [ "is-wsl", + "libc", "pathdiff", ] [[package]] name = "openssl" -version = "0.10.52" +version = "0.10.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01b8574602df80f7b85fdfc5392fa884a4e3b3f4f35402c070ab34c3d3f78d56" +checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d" dependencies = [ "bitflags 1.3.2", "cfg-if", @@ -2709,9 +2683,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.87" +version = "0.9.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e17f59264b2809d77ae94f0e1ebabc434773f370d6ca667bd223ea10e06cc7e" +checksum = "374533b0e45f3a7ced10fcaeccca020e66656bc03dac384f852e4e5a7a8104a6" dependencies = [ "cc", "libc", @@ -2774,29 +2748,20 @@ dependencies = [ "winapi", ] -[[package]] -name = "output_vt100" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628223faebab4e3e40667ee0b2336d34a5b960ff60ea743ddfdbcf7770bcfb66" -dependencies = [ - "winapi", -] - [[package]] name = "owned_ttf_parser" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "706de7e2214113d63a8238d1910463cfce781129a6f263d13fdb09ff64355ba4" +checksum = "d4586edfe4c648c71797a74c84bacb32b52b212eff5dfe2bb9f2c599844023e7" dependencies = [ - "ttf-parser 0.19.0", + "ttf-parser 0.20.0", ] [[package]] name = "parking" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" @@ -2848,9 +2813,9 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" @@ -2908,29 +2873,29 @@ checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" [[package]] name = "pin-project" -version = "1.0.12" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.12" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.39", ] [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -2950,7 +2915,7 @@ version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bd9647b268a3d3e14ff09c23201133a62589c658db02bb7388c7246aafe0590" dependencies = [ - "base64 0.21.0", + "base64 0.21.5", "indexmap 1.9.3", "line-wrap", "quick-xml", @@ -2960,9 +2925,9 @@ dependencies = [ [[package]] name = "png" -version = "0.17.8" +version = "0.17.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaeebc51f9e7d2c150d3f3bfeb667f2aa985db5ef1e3d212847bdedb488beeaa" +checksum = "dd75bf2d8dd3702b9707cdbc56a5b9ef42cec752eb8b3bafc01234558442aa64" dependencies = [ "bitflags 1.3.2", "crc32fast", @@ -3007,13 +2972,11 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "pretty_assertions" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a25e9bcb20aa780fd0bb16b72403a9064d6b3f22f026946029acb941a50af755" +checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66" dependencies = [ - "ctor", "diff", - "output_vt100", "yansi", ] @@ -3024,7 +2987,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", - "toml_edit 0.19.8", + "toml_edit 0.19.15", ] [[package]] @@ -3128,7 +3091,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.9", + "getrandom 0.2.11", ] [[package]] @@ -3154,9 +3117,9 @@ checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" [[package]] name = "rayon" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" dependencies = [ "either", "rayon-core", @@ -3164,14 +3127,12 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" dependencies = [ - "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "num_cpus", ] [[package]] @@ -3198,33 +3159,60 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "redox_users" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ - "getrandom 0.2.9", + "getrandom 0.2.11", "redox_syscall 0.2.16", "thiserror", ] [[package]] name = "regex" -version = "1.8.1" +version = "1.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax 0.8.2", +] + +[[package]] +name = "regex-automata" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af83e617f331cc6ae2da5443c602dfa5af81e517212d9d611a5b3ba1777b5370" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-syntax 0.8.2", ] [[package]] name = "regex-syntax" -version = "0.7.1" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" + +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "renderdoc-sys" @@ -3234,11 +3222,11 @@ checksum = "216080ab382b992234dda86873c18d4c48358f5cfcb70fd693d7f6f2131b628b" [[package]] name = "reqwest" -version = "0.11.17" +version = "0.11.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13293b639a097af28fc8a90f22add145a9c954e49d77da06263d58cf44d5fb91" +checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" dependencies = [ - "base64 0.21.0", + "base64 0.21.5", "bytes", "encoding_rs", "futures-core", @@ -3259,6 +3247,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", + "system-configuration", "tokio", "tokio-native-tls", "tokio-util", @@ -3268,7 +3257,7 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "winreg", + "winreg 0.50.0", ] [[package]] @@ -3285,7 +3274,7 @@ dependencies = [ "rgb", "svgfilters", "svgtypes", - "tiny-skia 0.9.0", + "tiny-skia 0.9.1", "usvg", ] @@ -3359,15 +3348,28 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.19" +version = "0.37.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" +checksum = "d4eb579851244c2c03e7c24f501c3432bed80b8f720af1d6e5b0e0f01555a035" dependencies = [ "bitflags 1.3.2", "errno", "io-lifetimes", "libc", - "linux-raw-sys", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustix" +version = "0.38.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc99bc2d4f1fed22595588a013687477aedf3cdcfb26558c559edb67b4d9b22e" +dependencies = [ + "bitflags 2.4.1", + "errno", + "libc", + "linux-raw-sys 0.4.11", "windows-sys 0.48.0", ] @@ -3389,9 +3391,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.13" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "safemem" @@ -3410,11 +3412,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" dependencies = [ - "windows-sys 0.42.0", + "windows-sys 0.48.0", ] [[package]] @@ -3425,9 +3427,9 @@ checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sctk-adwaita" @@ -3444,9 +3446,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.8.2" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" +checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -3457,9 +3459,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" +checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" dependencies = [ "core-foundation-sys", "libc", @@ -3485,18 +3487,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.162" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71b2f6e1ab5c2b98c05f0f35b236b22e8df7ead6ffbf51d7808da7f8817e7ab6" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.162" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2a0814352fd64b58489904a44ea8d90cb1a91dcb6b4f5ebabc32c8318e93cb6" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", @@ -3505,9 +3507,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.96" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ "itoa", "ryu", @@ -3570,9 +3572,9 @@ dependencies = [ [[package]] name = "simd-adler32" -version = "0.3.5" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "238abfbb77c1915110ad968465608b68e869e0772622c9656714e73e5a1a522f" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" [[package]] name = "similar" @@ -3597,9 +3599,9 @@ checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] @@ -3624,9 +3626,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "smart-debug" @@ -3687,6 +3689,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "spin" version = "0.9.8" @@ -3714,9 +3726,9 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "strict-num" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9df65f20698aeed245efdde3628a6b559ea1239bbb871af1b6e3b58c413b2bd1" +checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731" dependencies = [ "float-cmp", ] @@ -3809,7 +3821,7 @@ dependencies = [ "once_cell", "onig", "plist", - "regex-syntax", + "regex-syntax 0.7.5", "serde", "serde_json", "thiserror", @@ -3817,17 +3829,37 @@ dependencies = [ "yaml-rust", ] +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "tempfile" -version = "3.6.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" +checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" dependencies = [ - "autocfg", "cfg-if", - "fastrand", - "redox_syscall 0.3.5", - "rustix", + "fastrand 2.0.1", + "redox_syscall 0.4.1", + "rustix 0.38.25", "windows-sys 0.48.0", ] @@ -3844,27 +3876,27 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" dependencies = [ "winapi-util", ] [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", @@ -3873,9 +3905,9 @@ dependencies = [ [[package]] name = "tiff" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7449334f9ff2baf290d55d73983a7d6fa15e01198faef72af07e2a8db851e471" +checksum = "6d172b0f4d3fba17ba89811858b9d3d97f928aece846475bbda076ca46736211" dependencies = [ "flate2", "jpeg-decoder", @@ -3925,9 +3957,9 @@ dependencies = [ [[package]] name = "tiny-skia" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b610cd8b9a29feb9029c30f1e7bff634651b6e4e925388ee6cff4c68d901a3e" +checksum = "ce2986c82f77818c7b9144c70818fdde98db15308e329ae2f7204d767808fd3c" dependencies = [ "arrayref", "arrayvec", @@ -3977,17 +4009,17 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.28.0" +version = "1.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c786bf8134e5a3a166db9b29ab8f48134739014a3eca7bc6bfa95d673b136f" +checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" dependencies = [ - "autocfg", + "backtrace", "bytes", "libc", "mio", "num_cpus", "pin-project-lite", - "socket2", + "socket2 0.5.5", "windows-sys 0.48.0", ] @@ -4003,9 +4035,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", @@ -4017,14 +4049,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.3" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b403acf6f2bb0859c93c7f0d967cb4a75a7ac552100f9322faf64dc047669b21" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.19.8", + "toml_edit 0.19.15", ] [[package]] @@ -4050,11 +4082,11 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.8" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239410c8609e8125456927e6707163a3b1fdb40561e4b803bc041f466ccfdc13" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 1.9.3", + "indexmap 2.1.0", "serde", "serde_spanned", "toml_datetime", @@ -4081,11 +4113,10 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -4093,9 +4124,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.24" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", @@ -4104,9 +4135,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.30" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", ] @@ -4125,9 +4156,9 @@ checksum = "0609f771ad9c6155384897e1df4d948e692667cc0588548b68eb44d052b27633" [[package]] name = "ttf-parser" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44dcf002ae3b32cd25400d6df128c5babec3927cd1eb7ce813cfff20eb6c3746" +checksum = "17f77d76d837a7830fe1d4f12b7b4ba4192c1888001c7164257e4bc6d21d96b4" [[package]] name = "two-face" @@ -4204,9 +4235,9 @@ checksum = "2281c8c1d221438e373249e065ca4989c4c36952c211ff21a0ee91c44a3869e7" [[package]] name = "unicode-ident" -version = "1.0.8" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -4249,9 +4280,9 @@ checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" [[package]] name = "url" -version = "2.3.1" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna", @@ -4265,7 +4296,7 @@ version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b44e14b7678bcc5947b397991432d0c4e02a103958a0ed5e1b9b961ddd08b21" dependencies = [ - "base64 0.21.0", + "base64 0.21.5", "log", "pico-args", "usvg-parser", @@ -4337,7 +4368,7 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc" dependencies = [ - "getrandom 0.2.9", + "getrandom 0.2.11", ] [[package]] @@ -4360,15 +4391,15 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "waker-fn" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" +checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" [[package]] name = "walkdir" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" dependencies = [ "same-file", "winapi-util", @@ -4376,11 +4407,10 @@ dependencies = [ [[package]] name = "want" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "log", "try-lock", ] @@ -4398,9 +4428,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.85" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b6cb788c4e39112fbe1822277ef6fb3c55cd86b95cb3d3c4c1c9597e4ac74b4" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -4408,9 +4438,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.85" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35e522ed4105a9d626d885b35d62501b30d9666283a5c8be12c14a8bdafe7822" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" dependencies = [ "bumpalo", "log", @@ -4423,9 +4453,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.35" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "083abe15c5d88556b77bdf7aef403625be9e327ad37c62c4e4129af740168163" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" dependencies = [ "cfg-if", "js-sys", @@ -4435,9 +4465,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.85" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "358a79a0cb89d21db8120cbfb91392335913e4890665b1a7981d9e956903b434" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4445,9 +4475,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.85" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4783ce29f09b9d93134d41297aded3a712b7b979e9c6f28c32cb88c973a94869" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", @@ -4458,15 +4488,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.85" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a901d592cafaa4d711bc324edfaff879ac700b19c3dfd60058d2b445be2691eb" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "wasm-streams" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bbae3363c08332cadccd13b67db371814cd214c2524020932f0804b8cf7c078" +checksum = "b4609d447824375f43e1ffbc051b50ad8f4b3ae8219680c94452ea05eb240ac7" dependencies = [ "futures-util", "js-sys", @@ -4550,9 +4580,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.62" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b5f940c7edfdc6d12126d98c9ef4d1b3d470011c47c76a6581df47ad9ba721" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" dependencies = [ "js-sys", "wasm-bindgen", @@ -4596,7 +4626,7 @@ checksum = "625bea30a0ba50d88025f95c80211d1a85c86901423647fb74f397f614abbd9a" dependencies = [ "arrayvec", "bit-vec", - "bitflags 2.2.1", + "bitflags 2.4.1", "codespan-reporting", "log", "naga", @@ -4621,7 +4651,7 @@ dependencies = [ "arrayvec", "ash", "bit-set", - "bitflags 2.2.1", + "bitflags 2.4.1", "block", "core-graphics-types", "d3d12", @@ -4659,7 +4689,7 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5bd33a976130f03dcdcd39b3810c0c3fc05daf86f0aaf867db14bfb7c4a9a32b" dependencies = [ - "bitflags 2.2.1", + "bitflags 2.4.1", "js-sys", "web-sys", ] @@ -4700,9 +4730,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -4731,21 +4761,6 @@ dependencies = [ "windows-targets 0.42.2", ] -[[package]] -name = "windows-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-sys" version = "0.45.0" @@ -4761,7 +4776,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.0", + "windows-targets 0.48.5", ] [[package]] @@ -4781,17 +4796,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] @@ -4802,9 +4817,9 @@ checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" @@ -4814,9 +4829,9 @@ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" @@ -4826,9 +4841,9 @@ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" @@ -4838,9 +4853,9 @@ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" @@ -4850,9 +4865,9 @@ checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" @@ -4862,9 +4877,9 @@ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" @@ -4874,15 +4889,15 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winit" -version = "0.28.5" +version = "0.28.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94c9651471cd576737671fbf7081edfea43de3e06846dd9bd4e49ea803c9f55f" +checksum = "9596d90b45384f5281384ab204224876e8e8bf7d58366d9b795ad99aa9894b94" dependencies = [ "android-activity", "bitflags 1.3.2", @@ -4915,9 +4930,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.4.6" +version = "0.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61de7bac303dc551fe038e2b3cef0f571087a47571ea6e79a87692ac99b99699" +checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" dependencies = [ "memchr", ] @@ -4931,6 +4946,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + [[package]] name = "wio" version = "0.2.2" @@ -4948,7 +4973,7 @@ checksum = "079aee011e8a8e625d16df9e785de30a6b77f80a6126092d76a57375f96448da" dependencies = [ "assert-json-diff", "async-trait", - "base64 0.21.0", + "base64 0.21.5", "deadpool", "futures", "futures-timer", @@ -5031,9 +5056,9 @@ checksum = "a67300977d3dc3f8034dae89778f502b6ba20b269527b3223ba59c0cf393bb8a" [[package]] name = "xml-rs" -version = "0.8.9" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1fcc45bb67e8bd9c33ada4b861bccfe2506e726169f7c1081b95841b3758eb3" +checksum = "5a56c84a8ccd4258aed21c92f70c0f6dea75356b6892ae27c24139da456f9336" [[package]] name = "xmlparser" diff --git a/Cargo.toml b/Cargo.toml index f55a23c6..8ce953aa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,30 +13,30 @@ keywords = ["markdown", "viewer", "gpu"] [dependencies] wgpu_glyph = "0.20" -winit = "0.28.5" +winit = "0.28.7" wgpu = "0.16" -bytemuck = "1.13.1" +bytemuck = "1.14.0" lyon = "1.0.1" comrak = { version = "0.18.0", default-features = false, features = ["syntect"] } -open = "4.1.0" +open = "4.2.0" html5ever = "0.26.0" -image = "0.24.6" -clap = { version = "4.2.7", features = ["cargo"] } +image = "0.24.7" +clap = { version = "4.3.24", features = ["cargo"] } copypasta = "0.8.2" resvg = "0.32.0" usvg = "0.32.0" -tiny-skia = "0.9.0" -anyhow = "1.0.71" +tiny-skia = "0.9.1" +anyhow = "1.0.75" dirs = "5.0.1" -serde = { version = "1.0.162", features = ["derive"] } -toml = "0.7.3" -reqwest = { version = "0.11.17", features = ["blocking", "json", "stream"] } +serde = { version = "1.0.193", features = ["derive"] } +toml = "0.7.6" +reqwest = { version = "0.11.22", features = ["blocking", "json", "stream"] } font-kit = "0.11.0" memmap2 = "0.5.10" -log = "0.4.17" -env_logger = "0.10.0" -notify = "5.1.0" -clap_complete = "4.2.1" +log = "0.4.20" +env_logger = "0.10.1" +notify = "5.2.0" +clap_complete = "4.3.2" dark-light = "1.0.0" # We only decompress our own compressed data, so disable `safe-decode` and # `checked-decode` @@ -60,8 +60,8 @@ strip = true lto = true [dev-dependencies] -filetime = "0.2.21" +filetime = "0.2.22" insta = "1.34.0" -pretty_assertions = "1.3.0" -tempfile = "3.6.0" -wiremock = "0.5.18" +pretty_assertions = "1.4.0" +tempfile = "3.8.1" +wiremock = "0.5.21" From af47c5e92781faaf8d91f9c68411dbb7e316f143 Mon Sep 17 00:00:00 2001 From: Cosmic Horror Date: Wed, 22 Nov 2023 22:12:26 -0700 Subject: [PATCH 20/26] Update `two-face` --- Cargo.lock | 5 +++-- Cargo.toml | 6 +----- src/utils.rs | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5888c06a..c7713c45 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4162,10 +4162,11 @@ checksum = "17f77d76d837a7830fe1d4f12b7b4ba4192c1888001c7164257e4bc6d21d96b4" [[package]] name = "two-face" -version = "0.1.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "655eebf0a106a5b97728bfdc108e76a7f36f069625b328ddf02627ce3d5e9452" +checksum = "37bed2135b2459c7eefba72c906d374697eb15949c205f2f124e3636a46b5eeb" dependencies = [ + "once_cell", "serde", "syntect", ] diff --git a/Cargo.toml b/Cargo.toml index 8ce953aa..9db8ea81 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,16 +44,12 @@ lz4_flex = { version = "0.10.0", default-features = false, features = ["frame", pollster = "0.3.0" smart-debug = "0.0.2" syntect = "5.1.0" +two-face = "0.3.0" # Required for WGPU to work properly with Vulkan fontdb = { version = "0.13.1", features = ["fontconfig"] } human-panic = "1.2.2" -[dependencies.two-face] -version = "0.1.1" -default-features = false -features = ["extra-syntax"] - [profile.release-lto] inherits = "release" strip = true diff --git a/src/utils.rs b/src/utils.rs index 919682d9..db1ff12d 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -128,7 +128,7 @@ pub fn markdown_to_html(md: &str, syntax_theme: SyntaxTheme) -> String { options.render.unsafe_ = true; let theme_set = SyntectThemeSet::load_defaults(); - let syn_set = two_face::syntax::extra(); + let syn_set = two_face::syntax::extra_no_newlines(); let adapter = SyntectAdapterBuilder::new() .syntax_set(syn_set) .theme_set(theme_set) From 0b933d95b27c9613d3f2a854136b0403806017f8 Mon Sep 17 00:00:00 2001 From: Cosmic Horror Date: Wed, 22 Nov 2023 22:35:37 -0700 Subject: [PATCH 21/26] `cargo update` --- Cargo.lock | 802 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 475 insertions(+), 327 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c7713c45..83fe3ff3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -20,9 +20,9 @@ checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" [[package]] name = "addr2line" -version = "0.19.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] @@ -44,6 +44,18 @@ dependencies = [ "version_check", ] +[[package]] +name = "ahash" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + [[package]] name = "aho-corasick" version = "1.1.2" @@ -53,11 +65,17 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "android-activity" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40bc1575e653f158cbdc6ebcd917b9564e66321c5325c232c3591269c257be69" +checksum = "64529721f27c2314ced0890ce45e469574a73e5e6fdd6e9da1860eb29285f5e0" dependencies = [ "android-properties", "bitflags 1.3.2", @@ -163,9 +181,9 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "ash" -version = "0.37.2+1.3.238" +version = "0.37.3+1.3.251" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28bf19c1f0a470be5fbf7522a308a05df06610252c5bcf5143e1b23f629a9a03" +checksum = "39e9c3835d686b0a6084ab4234fcd1b07dbf6e4767dce60874b12356a25ecd4a" dependencies = [ "libloading 0.7.4", ] @@ -186,7 +204,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c48ccdbf6ca6b121e0f586cbc0e73ae440e56c67c30fa0873b4e110d9c26d2b" dependencies = [ - "event-listener", + "event-listener 2.5.3", "futures-core", ] @@ -197,21 +215,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" dependencies = [ "concurrent-queue", - "event-listener", + "event-listener 2.5.3", + "futures-core", +] + +[[package]] +name = "async-channel" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d37875bd9915b7d67c2f117ea2c30a0989874d0b2cb694fe25403c85763c0c9e" +dependencies = [ + "concurrent-queue", + "event-listener 3.1.0", + "event-listener-strategy", "futures-core", + "pin-project-lite", ] [[package]] name = "async-executor" -version = "1.5.1" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fa3dc5f2a8564f07759c008b9109dc0d39de92a88d5588b8a5036d286383afb" +checksum = "fc5ea910c42e5ab19012bab31f53cb4d63d54c3a27730f9a833a88efcf4bb52d" dependencies = [ - "async-lock", + "async-lock 3.1.1", "async-task", "concurrent-queue", - "fastrand 1.9.0", - "futures-lite", + "fastrand 2.0.1", + "futures-lite 2.0.1", "slab", ] @@ -221,10 +252,10 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "279cf904654eeebfa37ac9bb1598880884924aab82e290aa65c9e77a0e142e06" dependencies = [ - "async-lock", + "async-lock 2.8.0", "autocfg", "blocking", - "futures-lite", + "futures-lite 1.13.0", ] [[package]] @@ -233,51 +264,117 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ - "async-lock", + "async-lock 2.8.0", "autocfg", "cfg-if", "concurrent-queue", - "futures-lite", + "futures-lite 1.13.0", "log", "parking", - "polling", - "rustix 0.37.25", + "polling 2.8.0", + "rustix 0.37.27", + "slab", + "socket2 0.4.10", + "waker-fn", +] + +[[package]] +name = "async-io" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41ed9d5715c2d329bf1b4da8d60455b99b187f27ba726df2883799af9af60997" +dependencies = [ + "async-lock 3.1.1", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite 2.0.1", + "parking", + "polling 3.3.0", + "rustix 0.38.25", "slab", - "socket2 0.4.9", + "tracing", "waker-fn", + "windows-sys 0.48.0", ] [[package]] name = "async-lock" -version = "2.7.0" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +dependencies = [ + "event-listener 2.5.3", +] + +[[package]] +name = "async-lock" +version = "3.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "655b9c7fe787d3b25cc0f804a1a8401790f0c5bc395beb5a64dc77d8de079105" +dependencies = [ + "event-listener 3.1.0", + "event-listener-strategy", + "pin-project-lite", +] + +[[package]] +name = "async-process" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa24f727524730b077666307f2734b4a1a1c57acb79193127dcc8914d5242dd7" +checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" dependencies = [ - "event-listener", + "async-io 1.13.0", + "async-lock 2.8.0", + "async-signal", + "blocking", + "cfg-if", + "event-listener 3.1.0", + "futures-lite 1.13.0", + "rustix 0.38.25", + "windows-sys 0.48.0", ] [[package]] name = "async-recursion" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" +checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" dependencies = [ "proc-macro2", "quote", "syn 2.0.39", ] +[[package]] +name = "async-signal" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" +dependencies = [ + "async-io 2.2.0", + "async-lock 2.8.0", + "atomic-waker", + "cfg-if", + "futures-core", + "futures-io", + "rustix 0.38.25", + "signal-hook-registry", + "slab", + "windows-sys 0.48.0", +] + [[package]] name = "async-task" -version = "4.4.0" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" +checksum = "b4eb2cdb97421e01129ccb49169d8279ed21e829929144f4a22a6e54ac549ca1" [[package]] name = "async-trait" -version = "0.1.73" +version = "0.1.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", @@ -286,9 +383,9 @@ dependencies = [ [[package]] name = "atomic-waker" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" @@ -298,15 +395,15 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.67" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", "cfg-if", "libc", - "miniz_oxide 0.6.2", + "miniz_oxide", "object", "rustc-demangle", ] @@ -401,17 +498,18 @@ dependencies = [ [[package]] name = "blocking" -version = "1.3.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" +checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" dependencies = [ - "async-channel", - "async-lock", + "async-channel 2.1.0", + "async-lock 3.1.1", "async-task", - "atomic-waker", - "fastrand 1.9.0", - "futures-lite", - "log", + "fastrand 2.0.1", + "futures-io", + "futures-lite 2.0.1", + "piper", + "tracing", ] [[package]] @@ -589,9 +687,9 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" +checksum = "f057a694a54f12365049b0958a1685bb52d567f5593b355fbf685838e873d400" dependencies = [ "crossbeam-utils", ] @@ -682,9 +780,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.7" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" +checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" dependencies = [ "libc", ] @@ -812,9 +910,18 @@ dependencies = [ [[package]] name = "deadpool-runtime" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaa37046cc0f6c3cc6090fbdbf73ef0b8ef4cfcc37f6befc0020f63e8cf121e1" +checksum = "63dfa964fe2a66f3fde91fc70b267fe193d822c7e603e2a675a49a7f46ad3f49" + +[[package]] +name = "deranged" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +dependencies = [ + "powerfmt", +] [[package]] name = "derivative" @@ -835,9 +942,9 @@ checksum = "21d8ad60dd5b13a4ee6bd8fa2d5d88965c597c67bce32b5fc49c94f55cb50810" [[package]] name = "deunicode" -version = "0.4.3" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "850878694b7933ca4c9569d30a34b55031b9b139ee1fc7b94a527c4ef960d690" +checksum = "6a1abaf4d861455be59f64fd2b55606cb151fce304ede7165f410243ce96bde6" [[package]] name = "diff" @@ -847,9 +954,9 @@ checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" [[package]] name = "digest" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "crypto-common", @@ -929,7 +1036,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "libloading 0.8.0", + "libloading 0.8.1", ] [[package]] @@ -985,9 +1092,9 @@ checksum = "b5320ae4c3782150d900b79807611a59a99fc9a1d61d686faafc24b93fc8d7ca" [[package]] name = "enumflags2" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c041f5090df68b32bcd905365fd51769c8b9d553fe87fde0b683534f10c01bd2" +checksum = "5998b4f30320c9d93aed72f63af821bfdac50465b75428fce77b48ec482c3939" dependencies = [ "enumflags2_derive", "serde", @@ -995,9 +1102,9 @@ dependencies = [ [[package]] name = "enumflags2_derive" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745" +checksum = "f95e2801cd355d4a1a3e3953ce6ee5ae9603a5c833455343a8bfe3f44d418246" dependencies = [ "proc-macro2", "quote", @@ -1025,9 +1132,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c18ee0ed65a5f1f81cac6b1d213b69c35fa47d4252ad41f1486dbd8226fe36e" +checksum = "f258a7194e7f7c2a7837a8913aeab7fd8c383457034fa20ce4dd3dcb813e8eb8" dependencies = [ "libc", "windows-sys 0.48.0", @@ -1048,17 +1155,38 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +[[package]] +name = "event-listener" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d96b852f1345da36d551b9473fa1e2b1eb5c5195585c6c018118bc92a8d91160" +dependencies = [ + "event-listener 3.1.0", + "pin-project-lite", +] + [[package]] name = "exr" -version = "1.7.0" +version = "1.71.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1e481eb11a482815d3e9d618db8c42a93207134662873809335a92327440c18" +checksum = "832a761f35ab3e6664babfbdc6cef35a4860e816ec3916dcfd0882954e98a8a8" dependencies = [ "bit_field", "flume", "half", "lebe", - "miniz_oxide 0.7.1", + "miniz_oxide", "rayon-core", "smallvec", "zune-inflate", @@ -1117,7 +1245,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", - "miniz_oxide 0.7.1", + "miniz_oxide", ] [[package]] @@ -1134,23 +1262,16 @@ checksum = "7bad48618fdb549078c333a7a8528acb57af271d0433bdecd523eb620628364e" [[package]] name = "float_next_after" -version = "0.1.5" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fc612c5837986b7104a87a0df74a5460931f1c5274be12f8d0f40aa2f30d632" -dependencies = [ - "num-traits", -] +checksum = "8bf7cc16383c4b8d58b9905a8509f02926ce3058053c056376248d958c9df1e8" [[package]] name = "flume" -version = "0.10.14" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1657b4441c3403d9f7b3409e47575237dac27b1b5726df654a6ecbf92f0f7577" +checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" dependencies = [ - "futures-core", - "futures-sink", - "nanorand", - "pin-project", "spin", ] @@ -1187,9 +1308,9 @@ dependencies = [ [[package]] name = "fontconfig-parser" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ab2e12762761366dcb876ab8b6e0cfa4797ddcd890575919f008b5ba655672a" +checksum = "674e258f4b5d2dcd63888c01c68413c51f565e8af99d2f7701c7b81d79ef41c4" dependencies = [ "roxmltree", ] @@ -1224,9 +1345,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -1273,9 +1394,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" dependencies = [ "futures-channel", "futures-core", @@ -1288,9 +1409,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" dependencies = [ "futures-core", "futures-sink", @@ -1304,9 +1425,9 @@ checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" dependencies = [ "futures-core", "futures-task", @@ -1334,11 +1455,25 @@ dependencies = [ "waker-fn", ] +[[package]] +name = "futures-lite" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3831c2651acb5177cbd83943f3d9c8912c5ad03c76afcc0e9511ba568ec5ebb" +dependencies = [ + "fastrand 2.0.1", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", +] + [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" dependencies = [ "proc-macro2", "quote", @@ -1365,9 +1500,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" dependencies = [ "futures-channel", "futures-core", @@ -1419,10 +1554,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if", - "js-sys", "libc", "wasi 0.11.0+wasi-snapshot-preview1", - "wasm-bindgen", ] [[package]] @@ -1437,15 +1570,15 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.2" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "glow" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e007a07a24de5ecae94160f141029e9a347282cfe25d1d58d85d845cf3130f1" +checksum = "ca0fe580e4b60a8ab24a868bc08e2f03cbcb20d3d676601fa909386713333728" dependencies = [ "js-sys", "slotmap", @@ -1455,9 +1588,9 @@ dependencies = [ [[package]] name = "glyph_brush" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4edefd123f28a0b1d41ec4a489c2b43020b369180800977801611084f342978d" +checksum = "a3676f482c536a985fca36ce320a5e5b8fafd7b260806742af1963b71c5dc38c" dependencies = [ "glyph_brush_draw_cache", "glyph_brush_layout", @@ -1525,29 +1658,29 @@ dependencies = [ [[package]] name = "gpu-descriptor" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b0c02e1ba0bdb14e965058ca34e09c020f8e507a760df1121728e0aef68d57a" +checksum = "cc11df1ace8e7e564511f53af41f3e42ddc95b56fd07b3f4445d2a6048bc682c" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.1", "gpu-descriptor-types", - "hashbrown 0.12.3", + "hashbrown 0.14.2", ] [[package]] name = "gpu-descriptor-types" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "363e3677e55ad168fef68cf9de3a4a310b53124c5e784c53a1d70e92d23f2126" +checksum = "6bf0b36e6f090b7e1d8a4b49c0cb81c1f8376f72198c65dd3ad9ff3556b8b78c" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.1", ] [[package]] name = "h2" -version = "0.3.21" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" +checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" dependencies = [ "bytes", "fnv", @@ -1555,7 +1688,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 1.9.3", + "indexmap 2.1.0", "slab", "tokio", "tokio-util", @@ -1577,7 +1710,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash", + "ahash 0.7.7", ] [[package]] @@ -1585,6 +1718,10 @@ name = "hashbrown" version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" +dependencies = [ + "ahash 0.8.6", + "allocator-api2", +] [[package]] name = "hassle-rs" @@ -1662,9 +1799,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e9b187a72d63adbfba487f48095306ac823049cb504ee195541e91c7775f5ad" dependencies = [ "anyhow", - "async-channel", + "async-channel 1.9.0", "base64 0.13.1", - "futures-lite", + "futures-lite 1.13.0", "http", "infer", "pin-project-lite", @@ -1727,7 +1864,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.9", + "socket2 0.4.10", "tokio", "tower-service", "tracing", @@ -1749,9 +1886,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -1910,9 +2047,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-docker" @@ -1976,9 +2113,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" dependencies = [ "wasm-bindgen", ] @@ -1996,9 +2133,9 @@ dependencies = [ [[package]] name = "kqueue" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c8fc60ba15bf51257aa9807a48a61013db043fcf3a78cb0d916e8e396dcad98" +checksum = "7447f1ca1b7b563588a205fe93dea8df60fd981423a768bc1c0ded35ed147d0c" dependencies = [ "kqueue-sys", "libc", @@ -2006,9 +2143,9 @@ dependencies = [ [[package]] name = "kqueue-sys" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8367585489f01bc55dd27404dcf56b95e6da061a256a666ab23be9ba96a2e587" +checksum = "ed9625ffda8729b85e45cf04090035ac368927b8cebc34898e7c120f52e4838b" dependencies = [ "bitflags 1.3.2", "libc", @@ -2016,9 +2153,9 @@ dependencies = [ [[package]] name = "kurbo" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d676038719d1c892f91e6e85121550143c75880b42f7feff6d413a078cf91fb3" +checksum = "bd85a5776cd9500c2e2059c8c76c3b01528566b7fcbaf8098b55a33fc298849b" dependencies = [ "arrayvec", ] @@ -2059,9 +2196,9 @@ dependencies = [ [[package]] name = "libloading" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d580318f95776505201b28cf98eb1fa5e4be3b689633ba6a3e6cd880ff22d8cb" +checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" dependencies = [ "cfg-if", "windows-sys 0.48.0", @@ -2073,6 +2210,28 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +[[package]] +name = "libredox" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +dependencies = [ + "bitflags 2.4.1", + "libc", + "redox_syscall 0.4.1", +] + +[[package]] +name = "libredox" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3af92c55d7d839293953fcd0fda5ecfe93297cfde6ffbdec13b41d99c0ba6607" +dependencies = [ + "bitflags 2.4.1", + "libc", + "redox_syscall 0.4.1", +] + [[package]] name = "line-wrap" version = "0.1.1" @@ -2128,9 +2287,9 @@ dependencies = [ [[package]] name = "lyon_algorithms" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00a0349cd8f0270781bb93a824b63df6178e3b4a27794e7be3ce3763f5a44d6e" +checksum = "a3bca95f9a4955b3e4a821fbbcd5edfbd9be2a9a50bb5758173e5358bfb4c623" dependencies = [ "lyon_path", "num-traits", @@ -2149,9 +2308,9 @@ dependencies = [ [[package]] name = "lyon_path" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8358c012e5651e4619cfd0b5b75c0f77866181a01b0909aab4bae14adf660" +checksum = "ca507745ba7ccbc76e5c44e7b63b1a29d2b0d6126f375806a5bbaf657c7d6c45" dependencies = [ "lyon_geom", "num-traits", @@ -2159,9 +2318,9 @@ dependencies = [ [[package]] name = "lyon_tessellation" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d2124218d5428149f9e09520b9acc024334a607e671f032d06567b61008977c" +checksum = "23bcac20d47825850fabf1e869bf7c2bbe2daefa0776c3cd2eb7cb74635f6e4a" dependencies = [ "float_next_after", "lyon_path", @@ -2274,15 +2433,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" -[[package]] -name = "miniz_oxide" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" -dependencies = [ - "adler", -] - [[package]] name = "miniz_oxide" version = "0.7.1" @@ -2307,9 +2457,9 @@ dependencies = [ [[package]] name = "naga" -version = "0.12.0" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00ce114f2867153c079d4489629dbd27aa4b5387a8ba5341bd3f6dfe870688f" +checksum = "bbcc2e0513220fd2b598e6068608d4462db20322c0e77e47f6f488dfcfc279cb" dependencies = [ "bit-set", "bitflags 1.3.2", @@ -2325,15 +2475,6 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "nanorand" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" -dependencies = [ - "getrandom 0.2.11", -] - [[package]] name = "native-tls" version = "0.2.11" @@ -2414,15 +2555,14 @@ dependencies = [ [[package]] name = "nix" -version = "0.26.2" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" +checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" dependencies = [ "bitflags 1.3.2", "cfg-if", "libc", "memoffset 0.7.1", - "static_assertions", ] [[package]] @@ -2603,9 +2743,9 @@ dependencies = [ [[package]] name = "object" -version = "0.30.3" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ "memchr", ] @@ -2651,11 +2791,11 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.55" +version = "0.10.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d" +checksum = "79a4c6c3a2b158f7f8f2a2fc5a969fa3a068df6fc9dbb4a43845436e3af7c800" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.1", "cfg-if", "foreign-types", "libc", @@ -2683,9 +2823,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.90" +version = "0.9.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374533b0e45f3a7ced10fcaeccca020e66656bc03dac384f852e4e5a7a8104a6" +checksum = "3812c071ba60da8b5677cc12bcb1d42989a65553772897a7e0355545a819838f" dependencies = [ "cc", "libc", @@ -2701,18 +2841,18 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "orbclient" -version = "0.3.45" +version = "0.3.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "221d488cd70617f1bd599ed8ceb659df2147d9393717954d82a0f5e8032a6ab1" +checksum = "52f0d54bde9774d3a51dcf281a5def240c71996bc6ca05d2c847ec8b2b216166" dependencies = [ - "redox_syscall 0.3.5", + "libredox 0.0.2", ] [[package]] name = "ordered-float" -version = "3.7.0" +version = "4.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fc2dbde8f8a79f2102cc474ceb0ad68e3b80b85289ea62389b60e66777e4213" +checksum = "536900a8093134cf9ccf00a27deb3532421099e958d9dd431135d0c7543ca1e8" dependencies = [ "num-traits", ] @@ -2775,15 +2915,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.7" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.2.16", + "redox_syscall 0.4.1", "smallvec", - "windows-sys 0.45.0", + "windows-targets 0.48.5", ] [[package]] @@ -2804,28 +2944,18 @@ dependencies = [ [[package]] name = "pathfinder_simd" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39fe46acc5503595e5949c17b818714d26fdf9b4920eacf3b2947f0199f4a6ff" +checksum = "0444332826c70dc47be74a7c6a5fc44e23a7905ad6858d4162b658320455ef93" dependencies = [ "rustc_version", ] [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" - -[[package]] -name = "pest" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e68e84bfb01f0507134eac1e9b410a12ba379d064eab48c50ba4ce329a527b70" -dependencies = [ - "thiserror", - "ucd-trie", -] +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "phf" @@ -2871,26 +3001,6 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" -[[package]] -name = "pin-project" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] - [[package]] name = "pin-project-lite" version = "0.2.13" @@ -2903,6 +3013,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "piper" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +dependencies = [ + "atomic-waker", + "fastrand 2.0.1", + "futures-io", +] + [[package]] name = "pkg-config" version = "0.3.27" @@ -2911,12 +3032,12 @@ checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "plist" -version = "1.4.3" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bd9647b268a3d3e14ff09c23201133a62589c658db02bb7388c7246aafe0590" +checksum = "e5699cc8a63d1aa2b1ee8e12b9ad70ac790d65788cd36101fa37f87ea46c4cef" dependencies = [ "base64 0.21.5", - "indexmap 1.9.3", + "indexmap 2.1.0", "line-wrap", "quick-xml", "serde", @@ -2933,7 +3054,7 @@ dependencies = [ "crc32fast", "fdeflate", "flate2", - "miniz_oxide 0.7.1", + "miniz_oxide", ] [[package]] @@ -2952,12 +3073,32 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "polling" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e53b6af1f60f36f8c2ac2aad5459d75a5a9b4be1e8cdd40264f315d78193e531" +dependencies = [ + "cfg-if", + "concurrent-queue", + "pin-project-lite", + "rustix 0.38.25", + "tracing", + "windows-sys 0.48.0", +] + [[package]] name = "pollster" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22686f4785f02a4fcc856d3b3bb19bf6c8160d103f7a99cc258bddd0251dc7f2" +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -3001,9 +3142,9 @@ dependencies = [ [[package]] name = "profiling" -version = "1.0.8" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "332cd62e95873ea4f41f3dfd6bbbfc5b52aec892d7e8d534197c4720a0bbbab2" +checksum = "f89dff0959d98c9758c88826cc002e2c3d0b9dfac4139711d1f30de442f1139b" [[package]] name = "qoi" @@ -3016,9 +3157,9 @@ dependencies = [ [[package]] name = "quick-xml" -version = "0.28.2" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce5e73202a820a31f8a0ee32ada5e21029c81fd9e3ebf668a40832e4219d9d1" +checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" dependencies = [ "memchr", ] @@ -3141,15 +3282,6 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b42e27ef78c35d3998403c1d26f3efd9e135d3e5121b0a4845cc5cc27547f4f" -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.3.5" @@ -3170,12 +3302,12 @@ dependencies = [ [[package]] name = "redox_users" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" dependencies = [ "getrandom 0.2.11", - "redox_syscall 0.2.16", + "libredox 0.0.1", "thiserror", ] @@ -3286,9 +3418,9 @@ checksum = "4389f1d5789befaf6029ebd9f7dac4af7f7e3d61b69d4f30e2ac02b57e7712b0" [[package]] name = "rgb" -version = "0.8.36" +version = "0.8.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20ec2d3e3fc7a92ced357df9cebd5a10b6fb2aa1ee797bf7e9ce2f17dffc8f59" +checksum = "05aaa8004b64fd573fc9d002f4e632d51ad4f026c2b5ba95fcb6c2f32c2c47d8" dependencies = [ "bytemuck", ] @@ -3308,9 +3440,9 @@ dependencies = [ [[package]] name = "roxmltree" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8f595a457b6b8c6cda66a48503e92ee8d19342f905948f29c383200ec9eb1d8" +checksum = "862340e351ce1b271a378ec53f304a5558f7db87f3769dc655a8f6ecbb68b302" dependencies = [ "xmlparser", ] @@ -3339,18 +3471,18 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustc_version" -version = "0.3.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ "semver", ] [[package]] name = "rustix" -version = "0.37.25" +version = "0.37.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4eb579851244c2c03e7c24f501c3432bed80b8f720af1d6e5b0e0f01555a035" +checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" dependencies = [ "bitflags 1.3.2", "errno", @@ -3446,9 +3578,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.9.1" +version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -3459,9 +3591,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" dependencies = [ "core-foundation-sys", "libc", @@ -3469,21 +3601,9 @@ dependencies = [ [[package]] name = "semver" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver-parser" -version = "0.10.2" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" -dependencies = [ - "pest", -] +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" [[package]] name = "serde" @@ -3529,9 +3649,9 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.12" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcec881020c684085e55a25f7fd888954d56609ef363479dc5a1305eb0d40cab" +checksum = "3081f5ffbb02284dda55132aa26daecedd7372a42417bbbab6f14ab7d6bb9145" dependencies = [ "proc-macro2", "quote", @@ -3561,15 +3681,24 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", "digest", ] +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + [[package]] name = "simd-adler32" version = "0.3.7" @@ -3593,9 +3722,9 @@ dependencies = [ [[package]] name = "siphasher" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "slab" @@ -3617,11 +3746,12 @@ dependencies = [ [[package]] name = "slug" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3bc762e6a4b6c6fcaade73e77f9ebc6991b676f88bb2358bddb56560f073373" +checksum = "3bd94acec9c8da640005f8e135a39fc0372e74535e6b368b7a04b875f784c8c4" dependencies = [ "deunicode", + "wasm-bindgen", ] [[package]] @@ -3652,9 +3782,9 @@ dependencies = [ [[package]] name = "smithay-client-toolkit" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f307c47d32d2715eb2e0ece5589057820e0e5e70d07c247d1063e844e107f454" +checksum = "870427e30b8f2cbe64bf43ec4b86e88fe39b0a84b3f15efd9c9c2d020bc86eb9" dependencies = [ "bitflags 1.3.2", "calloop", @@ -3681,9 +3811,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi", @@ -3876,9 +4006,9 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" +checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" dependencies = [ "winapi-util", ] @@ -3916,11 +4046,13 @@ dependencies = [ [[package]] name = "time" -version = "0.3.21" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3403384eaacbca9923fa06940178ac13e4edb725486d70e8e15881d0c836cc" +checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" dependencies = [ + "deranged", "itoa", + "powerfmt", "serde", "time-core", "time-macros", @@ -3928,15 +4060,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.9" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "372950940a5f07bf38dbe211d7283c9e6d7327df53794992d293e534c733d09b" +checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" dependencies = [ "time-core", ] @@ -4190,15 +4322,9 @@ checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" [[package]] name = "typenum" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" - -[[package]] -name = "ucd-trie" -version = "0.1.5" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "uds_windows" @@ -4263,9 +4389,9 @@ checksum = "b1d386ff53b415b7fe27b50bb44679e2cc4660272694b7b6f3326d8480823a94" [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "unicode-xid" @@ -4281,9 +4407,9 @@ checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" [[package]] name = "url" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", @@ -4365,9 +4491,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.5.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc" +checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560" dependencies = [ "getrandom 0.2.11", ] @@ -4429,9 +4555,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -4439,9 +4565,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" dependencies = [ "bumpalo", "log", @@ -4454,9 +4580,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02" dependencies = [ "cfg-if", "js-sys", @@ -4466,9 +4592,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4476,9 +4602,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" dependencies = [ "proc-macro2", "quote", @@ -4489,9 +4615,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" [[package]] name = "wasm-streams" @@ -4581,9 +4707,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" dependencies = [ "js-sys", "wasm-bindgen", @@ -4597,9 +4723,9 @@ checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb" [[package]] name = "wgpu" -version = "0.16.0" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13edd72c7b08615b7179dd7e778ee3f0bdc870ef2de9019844ff2cceeee80b11" +checksum = "480c965c9306872eb6255fa55e4b4953be55a8b64d57e61d7ff840d3dcc051cd" dependencies = [ "arrayvec", "cfg-if", @@ -4621,9 +4747,9 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "625bea30a0ba50d88025f95c80211d1a85c86901423647fb74f397f614abbd9a" +checksum = "8f478237b4bf0d5b70a39898a66fa67ca3a007d79f2520485b8b0c3dfc46f8c2" dependencies = [ "arrayvec", "bit-vec", @@ -4644,9 +4770,9 @@ dependencies = [ [[package]] name = "wgpu-hal" -version = "0.16.0" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41af2ea7d87bd41ad0a37146252d5f7c26490209f47f544b2ee3b3ff34c7732e" +checksum = "1ecb3258078e936deee14fd4e0febe1cfe9bbb5ffef165cb60218d2ee5eb4448" dependencies = [ "android_system_properties", "arrayvec", @@ -4665,7 +4791,7 @@ dependencies = [ "js-sys", "khronos-egl", "libc", - "libloading 0.8.0", + "libloading 0.8.1", "log", "metal", "naga", @@ -4686,9 +4812,9 @@ dependencies = [ [[package]] name = "wgpu-types" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bd33a976130f03dcdcd39b3810c0c3fc05daf86f0aaf867db14bfb7c4a9a32b" +checksum = "d0c153280bb108c2979eb5c7391cb18c56642dd3c072e55f52065e13e2a1252a" dependencies = [ "bitflags 2.4.1", "js-sys", @@ -5045,7 +5171,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2769203cd13a0c6015d515be729c526d041e9cf2c0cc478d57faee85f40c6dcd" dependencies = [ - "nix 0.26.2", + "nix 0.26.4", "winapi", ] @@ -5057,15 +5183,15 @@ checksum = "a67300977d3dc3f8034dae89778f502b6ba20b269527b3223ba59c0cf393bb8a" [[package]] name = "xml-rs" -version = "0.8.15" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a56c84a8ccd4258aed21c92f70c0f6dea75356b6892ae27c24139da456f9336" +checksum = "0fcb9cbac069e033553e8bb871be2fbdffcab578eb25bd0f7c508cedc6dcd75a" [[package]] name = "xmlparser" -version = "0.13.5" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d25c75bf9ea12c4040a97f829154768bbbce366287e2dc044af160cd79a13fd" +checksum = "66fee0b777b0f5ac1c69bb06d361268faafa61cd4682ae064a171c16c433e9e4" [[package]] name = "xmlwriter" @@ -5102,27 +5228,29 @@ dependencies = [ [[package]] name = "zbus" -version = "3.12.0" +version = "3.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29242fa5ec5693629ae74d6eb1f69622a9511f600986d6d9779bccf36ac316e3" +checksum = "31de390a2d872e4cd04edd71b425e29853f786dc99317ed72d73d6fcf5ebb948" dependencies = [ "async-broadcast", "async-executor", "async-fs", - "async-io", - "async-lock", + "async-io 1.13.0", + "async-lock 2.8.0", + "async-process", "async-recursion", "async-task", "async-trait", + "blocking", "byteorder", "derivative", "enumflags2", - "event-listener", + "event-listener 2.5.3", "futures-core", "futures-sink", "futures-util", "hex", - "nix 0.26.2", + "nix 0.26.4", "once_cell", "ordered-stream", "rand 0.8.5", @@ -5141,9 +5269,9 @@ dependencies = [ [[package]] name = "zbus_macros" -version = "3.12.0" +version = "3.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "537793e26e9af85f774801dc52c6f6292352b2b517c5cf0449ffd3735732a53a" +checksum = "41d1794a946878c0e807f55a397187c11fc7a038ba5d868e7db4f3bd7760bc9d" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -5155,15 +5283,35 @@ dependencies = [ [[package]] name = "zbus_names" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f34f314916bd89bdb9934154627fab152f4f28acdda03e7c4c68181b214fe7e3" +checksum = "fb80bb776dbda6e23d705cf0123c3b95df99c4ebeaec6c2599d4a5419902b4a9" dependencies = [ "serde", "static_assertions", "zvariant", ] +[[package]] +name = "zerocopy" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + [[package]] name = "zune-inflate" version = "0.2.54" @@ -5175,9 +5323,9 @@ dependencies = [ [[package]] name = "zvariant" -version = "3.12.0" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46fe4914a985446d6fd287019b5fceccce38303d71407d9e6e711d44954a05d8" +checksum = "44b291bee0d960c53170780af148dca5fa260a63cdd24f1962fa82e03e53338c" dependencies = [ "byteorder", "enumflags2", @@ -5189,9 +5337,9 @@ dependencies = [ [[package]] name = "zvariant_derive" -version = "3.12.0" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34c20260af4b28b3275d6676c7e2a6be0d4332e8e0aba4616d34007fd84e462a" +checksum = "934d7a7dfc310d6ee06c87ffe88ef4eca7d3e37bb251dece2ef93da8f17d8ecd" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -5202,9 +5350,9 @@ dependencies = [ [[package]] name = "zvariant_utils" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53b22993dbc4d128a17a3b6c92f1c63872dd67198537ee728d8b5d7c40640a8b" +checksum = "7234f0d811589db492d16893e3f21e8e2fd282e6d01b0cddee310322062cc200" dependencies = [ "proc-macro2", "quote", From fc8bfeda34af0ada0e51de52616bc6ca43cdb6f8 Mon Sep 17 00:00:00 2001 From: Cosmic Horror Date: Wed, 22 Nov 2023 22:49:59 -0700 Subject: [PATCH 22/26] Update simple dependencies --- Cargo.lock | 461 +++++++++++++++++++++++++++++++++++++++++++---------- Cargo.toml | 18 +-- 2 files changed, 389 insertions(+), 90 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 83fe3ff3..33c8daa0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -564,6 +564,32 @@ dependencies = [ "vec_map", ] +[[package]] +name = "calloop" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b50b5a44d59a98c55a9eeb518f39bf7499ba19fd98ee7d22618687f3f10adbf" +dependencies = [ + "bitflags 2.4.1", + "log", + "polling 3.3.0", + "rustix 0.38.25", + "slab", + "thiserror", +] + +[[package]] +name = "calloop-wayland-source" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f0ea9b9476c7fad82841a8dbb380e2eae480c21910feba80725b46931ed8f02" +dependencies = [ + "calloop 0.12.3", + "rustix 0.38.25", + "wayland-backend", + "wayland-client 0.31.1", +] + [[package]] name = "cc" version = "1.0.83" @@ -671,10 +697,11 @@ checksum = "bf43edc576402991846b093a7ca18a3477e0ef9c588cde84964b5d3e43016642" [[package]] name = "comrak" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "482aa5695bca086022be453c700a40c02893f1ba7098a2c88351de55341ae894" +checksum = "82c995deda3bfdebd07d0e2af79e9da13e4b1be652b21a746f3f5b24bf0a49ef" dependencies = [ + "derive_builder", "entities", "memchr", "once_cell", @@ -714,9 +741,9 @@ checksum = "ed3d0b5ff30645a68f35ece8cea4556ca14ef8a1651455f789a099a0513532a6" [[package]] name = "copypasta" -version = "0.8.2" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "133fc8675ee3a4ec9aa513584deda9aa0faeda3586b87f7f0f2ba082c66fb172" +checksum = "6d35364349bf9e9e1c3a035ddcb00d188d23a3c40c50244c03c27a99fc6a65ae" dependencies = [ "clipboard-win", "objc", @@ -751,7 +778,7 @@ dependencies = [ "bitflags 1.3.2", "core-foundation", "core-graphics-types", - "foreign-types", + "foreign-types 0.3.2", "libc", ] @@ -774,7 +801,7 @@ checksum = "99d74ada66e07c1cefa18f8abfba765b486f250de2e4a999e5727fc0dd4b4a25" dependencies = [ "core-foundation", "core-graphics", - "foreign-types", + "foreign-types 0.3.2", "libc", ] @@ -855,14 +882,20 @@ dependencies = [ "typenum", ] +[[package]] +name = "cursor-icon" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991" + [[package]] name = "d3d12" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8f0de2f5a8e7bd4a9eec0e3c781992a4ce1724f68aec7d7a3715344de8b39da" +checksum = "e16e44ab292b1dddfdaf7be62cfd8877df52f2f3fde5858d95bab606be259f20" dependencies = [ - "bitflags 1.3.2", - "libloading 0.7.4", + "bitflags 2.4.1", + "libloading 0.8.1", "winapi", ] @@ -883,6 +916,41 @@ dependencies = [ "zvariant", ] +[[package]] +name = "darling" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +dependencies = [ + "darling_core", + "quote", + "syn 1.0.109", +] + [[package]] name = "data-url" version = "0.2.0" @@ -934,6 +1002,37 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive_builder" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder_macro" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" +dependencies = [ + "derive_builder_core", + "syn 1.0.109", +] + [[package]] name = "detect-desktop-environment" version = "0.2.0" @@ -1323,18 +1422,53 @@ checksum = "237ff9f0813bbfc9de836016472e0c9ae7802f174a51594607e5f4ff334cb2f5" dependencies = [ "fontconfig-parser", "log", - "memmap2", + "memmap2 0.5.10", "slotmap", "ttf-parser 0.18.1", ] +[[package]] +name = "fontdb" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98b88c54a38407f7352dd2c4238830115a6377741098ffd1f997c813d0e088a6" +dependencies = [ + "fontconfig-parser", + "log", + "memmap2 0.9.0", + "slotmap", + "tinyvec", + "ttf-parser 0.20.0", +] + [[package]] name = "foreign-types" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" dependencies = [ - "foreign-types-shared", + "foreign-types-shared 0.1.1", +] + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared 0.3.1", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", ] [[package]] @@ -1343,6 +1477,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + [[package]] name = "form_urlencoded" version = "1.2.1" @@ -1528,9 +1668,9 @@ dependencies = [ [[package]] name = "gethostname" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e" +checksum = "bb65d4ba3173c56a500b555b532f72c42e8d1fe64962b518897f8959fae2c177" dependencies = [ "libc", "winapi", @@ -1626,21 +1766,21 @@ dependencies = [ [[package]] name = "gpu-alloc" -version = "0.5.4" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22beaafc29b38204457ea030f6fb7a84c9e4dd1b86e311ba0542533453d87f62" +checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.1", "gpu-alloc-types", ] [[package]] name = "gpu-alloc-types" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54804d0d6bc9d7f26db4eaec1ad10def69b599315f487d32c334a80d1efe67a5" +checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.1", ] [[package]] @@ -1884,6 +2024,12 @@ dependencies = [ "tokio-native-tls", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "0.5.0" @@ -1960,7 +2106,7 @@ dependencies = [ "env_logger", "filetime", "font-kit", - "fontdb", + "fontdb 0.16.0", "html5ever", "human-panic", "image", @@ -1968,7 +2114,7 @@ dependencies = [ "log", "lyon", "lz4_flex", - "memmap2", + "memmap2 0.9.0", "notify", "open", "pollster", @@ -2329,9 +2475,9 @@ dependencies = [ [[package]] name = "lz4_flex" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b8c72594ac26bfd34f2d99dfced2edfaddfe8a476e3ff2ca0eb293d925c4f83" +checksum = "3ea9b256699eda7b0387ffbc776dd625e28bde3918446381781245b7a50349d8" dependencies = [ "twox-hash", ] @@ -2380,6 +2526,15 @@ dependencies = [ "libc", ] +[[package]] +name = "memmap2" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "deaba38d7abf1d4cca21cc89e932e542ba2b9258664d2a9ef0e61512039c9375" +dependencies = [ + "libc", +] + [[package]] name = "memoffset" version = "0.6.5" @@ -2409,16 +2564,17 @@ dependencies = [ [[package]] name = "metal" -version = "0.24.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de11355d1f6781482d027a3b4d4de7825dcedb197bf573e0596d00008402d060" +checksum = "623b5e6cefd76e58f774bd3cc0c6f5c7615c58c03a97815245a25c3c9bdee318" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.1", "block", "core-graphics-types", - "foreign-types", + "foreign-types 0.5.0", "log", "objc", + "paste", ] [[package]] @@ -2457,12 +2613,12 @@ dependencies = [ [[package]] name = "naga" -version = "0.12.3" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbcc2e0513220fd2b598e6068608d4462db20322c0e77e47f6f488dfcfc279cb" +checksum = "c1ceaaa4eedaece7e4ec08c55c640ba03dbb73fb812a6570a59bcf1930d0f70e" dependencies = [ "bit-set", - "bitflags 1.3.2", + "bitflags 2.4.1", "codespan-reporting", "hexf-parse", "indexmap 1.9.3", @@ -2577,20 +2733,21 @@ dependencies = [ [[package]] name = "notify" -version = "5.2.0" +version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "729f63e1ca555a43fe3efa4f3efdf4801c479da85b432242a7b726f353c88486" +checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.1", "crossbeam-channel", "filetime", "fsevent-sys", "inotify", "kqueue", "libc", + "log", "mio", "walkdir", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -2780,9 +2937,9 @@ dependencies = [ [[package]] name = "open" -version = "4.2.0" +version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a083c0c7e5e4a8ec4176346cf61f67ac674e8bfb059d9226e1c54a96b377c12" +checksum = "90878fb664448b54c4e592455ad02831e23a3f7e157374a8b95654731aac7349" dependencies = [ "is-wsl", "libc", @@ -2797,7 +2954,7 @@ checksum = "79a4c6c3a2b158f7f8f2a2fc5a969fa3a068df6fc9dbb4a43845436e3af7c800" dependencies = [ "bitflags 2.4.1", "cfg-if", - "foreign-types", + "foreign-types 0.3.2", "libc", "once_cell", "openssl-macros", @@ -2926,6 +3083,12 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + [[package]] name = "pathdiff" version = "0.2.1" @@ -3039,7 +3202,7 @@ dependencies = [ "base64 0.21.5", "indexmap 2.1.0", "line-wrap", - "quick-xml", + "quick-xml 0.31.0", "serde", "time", ] @@ -3155,6 +3318,15 @@ dependencies = [ "bytemuck", ] +[[package]] +name = "quick-xml" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eff6510e86862b57b210fd8cbe8ed3f0d7d600b9c2863cd4549a2e033c66e956" +dependencies = [ + "memchr", +] + [[package]] name = "quick-xml" version = "0.31.0" @@ -3571,8 +3743,8 @@ checksum = "cda4e97be1fd174ccc2aae81c8b694e803fa99b34e8fd0f057a9d70698e3ed09" dependencies = [ "ab_glyph", "log", - "memmap2", - "smithay-client-toolkit", + "memmap2 0.5.10", + "smithay-client-toolkit 0.16.1", "tiny-skia 0.8.4", ] @@ -3787,26 +3959,52 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "870427e30b8f2cbe64bf43ec4b86e88fe39b0a84b3f15efd9c9c2d020bc86eb9" dependencies = [ "bitflags 1.3.2", - "calloop", + "calloop 0.10.6", "dlib", "lazy_static", "log", - "memmap2", + "memmap2 0.5.10", "nix 0.24.3", "pkg-config", - "wayland-client", - "wayland-cursor", - "wayland-protocols", + "wayland-client 0.29.5", + "wayland-cursor 0.29.5", + "wayland-protocols 0.29.5", +] + +[[package]] +name = "smithay-client-toolkit" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60e3d9941fa3bacf7c2bf4b065304faa14164151254cd16ce1b1bc8fc381600f" +dependencies = [ + "bitflags 2.4.1", + "calloop 0.12.3", + "calloop-wayland-source", + "cursor-icon", + "libc", + "log", + "memmap2 0.9.0", + "rustix 0.38.25", + "thiserror", + "wayland-backend", + "wayland-client 0.31.1", + "wayland-csd-frame", + "wayland-cursor 0.31.0", + "wayland-protocols 0.31.0", + "wayland-protocols-wlr", + "wayland-scanner 0.31.0", + "xkeysym", ] [[package]] name = "smithay-clipboard" -version = "0.6.6" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a345c870a1fae0b1b779085e81b51e614767c239e93503588e54c5b17f4b0e8" +checksum = "0bb62b280ce5a5cba847669933a0948d00904cf83845c944eae96a4738cea1a6" dependencies = [ - "smithay-client-toolkit", - "wayland-client", + "libc", + "smithay-client-toolkit 0.18.0", + "wayland-backend", ] [[package]] @@ -4310,7 +4508,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ "cfg-if", - "rand 0.8.5", + "rand 0.7.3", "static_assertions", ] @@ -4455,7 +4653,7 @@ version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c4fed019d1af07bfe0f3bac13d120d7b51bc65b38cb24809cf4ed0b8b631138" dependencies = [ - "fontdb", + "fontdb 0.13.1", "kurbo", "log", "rustybuzz", @@ -4632,6 +4830,20 @@ dependencies = [ "web-sys", ] +[[package]] +name = "wayland-backend" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19152ddd73f45f024ed4534d9ca2594e0ef252c1847695255dae47f34df9fbe4" +dependencies = [ + "cc", + "downcast-rs", + "nix 0.26.4", + "scoped-tls", + "smallvec", + "wayland-sys 0.31.1", +] + [[package]] name = "wayland-client" version = "0.29.5" @@ -4644,8 +4856,20 @@ dependencies = [ "nix 0.24.3", "scoped-tls", "wayland-commons", - "wayland-scanner", - "wayland-sys", + "wayland-scanner 0.29.5", + "wayland-sys 0.29.5", +] + +[[package]] +name = "wayland-client" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ca7d52347346f5473bf2f56705f360e8440873052e575e55890c4fa57843ed3" +dependencies = [ + "bitflags 2.4.1", + "nix 0.26.4", + "wayland-backend", + "wayland-scanner 0.31.0", ] [[package]] @@ -4657,7 +4881,18 @@ dependencies = [ "nix 0.24.3", "once_cell", "smallvec", - "wayland-sys", + "wayland-sys 0.29.5", +] + +[[package]] +name = "wayland-csd-frame" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" +dependencies = [ + "bitflags 2.4.1", + "cursor-icon", + "wayland-backend", ] [[package]] @@ -4667,7 +4902,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6865c6b66f13d6257bef1cd40cbfe8ef2f150fb8ebbdb1e8e873455931377661" dependencies = [ "nix 0.24.3", - "wayland-client", + "wayland-client 0.29.5", + "xcursor", +] + +[[package]] +name = "wayland-cursor" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44aa20ae986659d6c77d64d808a046996a932aa763913864dc40c359ef7ad5b" +dependencies = [ + "nix 0.26.4", + "wayland-client 0.31.1", "xcursor", ] @@ -4678,9 +4924,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b950621f9354b322ee817a23474e479b34be96c2e909c14f7bc0100e9a970bc6" dependencies = [ "bitflags 1.3.2", - "wayland-client", + "wayland-client 0.29.5", "wayland-commons", - "wayland-scanner", + "wayland-scanner 0.29.5", +] + +[[package]] +name = "wayland-protocols" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e253d7107ba913923dc253967f35e8561a3c65f914543e46843c88ddd729e21c" +dependencies = [ + "bitflags 2.4.1", + "wayland-backend", + "wayland-client 0.31.1", + "wayland-scanner 0.31.0", +] + +[[package]] +name = "wayland-protocols-wlr" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6" +dependencies = [ + "bitflags 2.4.1", + "wayland-backend", + "wayland-client 0.31.1", + "wayland-protocols 0.31.0", + "wayland-scanner 0.31.0", ] [[package]] @@ -4694,6 +4965,17 @@ dependencies = [ "xml-rs", ] +[[package]] +name = "wayland-scanner" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb8e28403665c9f9513202b7e1ed71ec56fde5c107816843fb14057910b2c09c" +dependencies = [ + "proc-macro2", + "quick-xml 0.30.0", + "quote", +] + [[package]] name = "wayland-sys" version = "0.29.5" @@ -4705,6 +4987,18 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "wayland-sys" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15a0c8eaff5216d07f226cb7a549159267f3467b289d9a2e52fd3ef5aae2b7af" +dependencies = [ + "dlib", + "log", + "once_cell", + "pkg-config", +] + [[package]] name = "web-sys" version = "0.3.65" @@ -4723,9 +5017,9 @@ checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb" [[package]] name = "wgpu" -version = "0.16.3" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "480c965c9306872eb6255fa55e4b4953be55a8b64d57e61d7ff840d3dcc051cd" +checksum = "752e44d3998ef35f71830dd1ad3da513e628e2e4d4aedb0ab580f850827a0b41" dependencies = [ "arrayvec", "cfg-if", @@ -4747,9 +5041,9 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "0.16.1" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f478237b4bf0d5b70a39898a66fa67ca3a007d79f2520485b8b0c3dfc46f8c2" +checksum = "0f8a44dd301a30ceeed3c27d8c0090433d3da04d7b2a4042738095a424d12ae7" dependencies = [ "arrayvec", "bit-vec", @@ -4770,9 +5064,9 @@ dependencies = [ [[package]] name = "wgpu-hal" -version = "0.16.2" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ecb3258078e936deee14fd4e0febe1cfe9bbb5ffef165cb60218d2ee5eb4448" +checksum = "9a80bf0e3c77399bb52850cb0830af9bad073d5cfcb9dd8253bef8125c42db17" dependencies = [ "android_system_properties", "arrayvec", @@ -4782,7 +5076,6 @@ dependencies = [ "block", "core-graphics-types", "d3d12", - "foreign-types", "glow", "gpu-alloc", "gpu-allocator", @@ -4812,9 +5105,9 @@ dependencies = [ [[package]] name = "wgpu-types" -version = "0.16.1" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c153280bb108c2979eb5c7391cb18c56642dd3c072e55f52065e13e2a1252a" +checksum = "ee64d7398d0c2f9ca48922c902ef69c42d000c759f3db41e355f4a570b052b67" dependencies = [ "bitflags 2.4.1", "js-sys", @@ -4823,9 +5116,9 @@ dependencies = [ [[package]] name = "wgpu_glyph" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb849776538364c4d7571aca9718e2cb5ab973bee3cf5e127b83eab7616e33f" +checksum = "d10e4593fcbe13066b7d9d97416174c724285b5430c9bc5c6b23b0ed49ccf6f1" dependencies = [ "bytemuck", "glyph_brush", @@ -5044,12 +5337,12 @@ dependencies = [ "raw-window-handle", "redox_syscall 0.3.5", "sctk-adwaita", - "smithay-client-toolkit", + "smithay-client-toolkit 0.16.1", "wasm-bindgen", - "wayland-client", + "wayland-client 0.29.5", "wayland-commons", - "wayland-protocols", - "wayland-scanner", + "wayland-protocols 0.29.5", + "wayland-scanner 0.29.5", "web-sys", "windows-sys 0.45.0", "x11-dl", @@ -5116,9 +5409,9 @@ dependencies = [ [[package]] name = "x11-clipboard" -version = "0.7.1" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "980b9aa9226c3b7de8e2adb11bf20124327c054e0e5812d2aac0b5b5a87e7464" +checksum = "b41aca1115b1f195f21c541c5efb423470848d48143127d0f07f8b90c27440df" dependencies = [ "x11rb", ] @@ -5136,12 +5429,12 @@ dependencies = [ [[package]] name = "x11rb" -version = "0.10.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "592b4883219f345e712b3209c62654ebda0bb50887f330cbd018d0f654bfd507" +checksum = "b1641b26d4dec61337c35a1b1aaf9e3cba8f46f0b43636c609ab0291a648040a" dependencies = [ "gethostname", - "nix 0.24.3", + "nix 0.26.4", "winapi", "winapi-wsapoll", "x11rb-protocol", @@ -5149,11 +5442,11 @@ dependencies = [ [[package]] name = "x11rb-protocol" -version = "0.10.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56b245751c0ac9db0e006dc812031482784e434630205a93c73cfefcaabeac67" +checksum = "82d6c3f9a0fb6701fab8f6cea9b0c0bd5d6876f1f89f7fada07e558077c344bc" dependencies = [ - "nix 0.24.3", + "nix 0.26.4", ] [[package]] @@ -5181,6 +5474,12 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a67300977d3dc3f8034dae89778f502b6ba20b269527b3223ba59c0cf393bb8a" +[[package]] +name = "xkeysym" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "054a8e68b76250b253f671d1268cb7f1ae089ec35e195b2efb2a4e9a836d0621" + [[package]] name = "xml-rs" version = "0.8.19" diff --git a/Cargo.toml b/Cargo.toml index 9db8ea81..07c7bdb3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,17 +12,17 @@ rust-version = "1.65" keywords = ["markdown", "viewer", "gpu"] [dependencies] -wgpu_glyph = "0.20" +wgpu_glyph = "0.21" winit = "0.28.7" -wgpu = "0.16" +wgpu = "0.17" bytemuck = "1.14.0" lyon = "1.0.1" -comrak = { version = "0.18.0", default-features = false, features = ["syntect"] } -open = "4.2.0" +comrak = { version = "0.19.0", default-features = false, features = ["syntect"] } +open = "5.0.1" html5ever = "0.26.0" image = "0.24.7" clap = { version = "4.3.24", features = ["cargo"] } -copypasta = "0.8.2" +copypasta = "0.10.0" resvg = "0.32.0" usvg = "0.32.0" tiny-skia = "0.9.1" @@ -32,22 +32,22 @@ serde = { version = "1.0.193", features = ["derive"] } toml = "0.7.6" reqwest = { version = "0.11.22", features = ["blocking", "json", "stream"] } font-kit = "0.11.0" -memmap2 = "0.5.10" +memmap2 = "0.9.0" log = "0.4.20" env_logger = "0.10.1" -notify = "5.2.0" +notify = "6.1.1" clap_complete = "4.3.2" dark-light = "1.0.0" # We only decompress our own compressed data, so disable `safe-decode` and # `checked-decode` -lz4_flex = { version = "0.10.0", default-features = false, features = ["frame", "safe-encode", "std"] } +lz4_flex = { version = "0.11.1", default-features = false, features = ["frame", "safe-encode", "std"] } pollster = "0.3.0" smart-debug = "0.0.2" syntect = "5.1.0" two-face = "0.3.0" # Required for WGPU to work properly with Vulkan -fontdb = { version = "0.13.1", features = ["fontconfig"] } +fontdb = { version = "0.16.0", features = ["fontconfig"] } human-panic = "1.2.2" [profile.release-lto] From 767e3b88b6e739819d1eaf79608c05459499f3a1 Mon Sep 17 00:00:00 2001 From: Cosmic Horror Date: Wed, 22 Nov 2023 23:13:33 -0700 Subject: [PATCH 23/26] Update `smart-debug` --- Cargo.lock | 10 +++++----- Cargo.toml | 2 +- src/image/mod.rs | 12 ++++++------ src/text.rs | 6 +++--- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 33c8daa0..66a0310e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3934,18 +3934,18 @@ checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "smart-debug" -version = "0.0.2" +version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5502c61a245a5ded27cb2e4a49cac93b3527d0653ca517769aaa96138ff3241" +checksum = "54708a918472ed0a5cb90775fd2bd649c949e1630c973901bc2cff987710d98b" dependencies = [ "smart-debug-derive", ] [[package]] name = "smart-debug-derive" -version = "0.0.2" +version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34e5f490c4650ac837987490484f6b105ea9d317a93083a0f94f4de3ffc7b1ba" +checksum = "e217678d06a85df0b9ac15c6c74ebc68b2d43c95ede39e126e21b4c89d314056" dependencies = [ "proc-macro2", "quote", @@ -4508,7 +4508,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ "cfg-if", - "rand 0.7.3", + "rand 0.8.5", "static_assertions", ] diff --git a/Cargo.toml b/Cargo.toml index 07c7bdb3..f5430764 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,7 +42,7 @@ dark-light = "1.0.0" # `checked-decode` lz4_flex = { version = "0.11.1", default-features = false, features = ["frame", "safe-encode", "std"] } pollster = "0.3.0" -smart-debug = "0.0.2" +smart-debug = "0.0.3" syntect = "5.1.0" two-face = "0.3.0" diff --git a/src/image/mod.rs b/src/image/mod.rs index bdd3b13c..48adbc72 100644 --- a/src/image/mod.rs +++ b/src/image/mod.rs @@ -79,17 +79,17 @@ impl ImageData { #[derive(SmartDebug, Default)] pub struct Image { - #[debug(ignore_fn = debug_ignore_image_data)] + #[debug(skip_fn = debug_ignore_image_data)] pub image_data: Arc>>, - #[debug(ignore_fn = Option::is_none, wrapper = DebugInline)] + #[debug(skip_fn = Option::is_none, wrapper = DebugInline)] pub is_aligned: Option, - #[debug(ignore_fn = Option::is_none, wrapper = DebugInline)] + #[debug(skip_fn = Option::is_none, wrapper = DebugInline)] pub size: Option, - #[debug(ignore)] + #[debug(skip)] pub bind_group: Option>, - #[debug(ignore_fn = Option::is_none, wrapper = DebugInline)] + #[debug(skip_fn = Option::is_none, wrapper = DebugInline)] pub is_link: Option, - #[debug(ignore)] + #[debug(skip)] pub hidpi_scale: f32, } diff --git a/src/text.rs b/src/text.rs index b412c9fd..c545e8f4 100644 --- a/src/text.rs +++ b/src/text.rs @@ -11,7 +11,7 @@ use wgpu_glyph::{ }; #[derive(SmartDebug, Clone)] -#[debug(ignore_defaults)] +#[debug(skip_defaults)] pub struct TextBox { pub align: Align, pub indent: f32, @@ -25,9 +25,9 @@ pub struct TextBox { pub is_checkbox: Option, #[debug(wrapper = DebugInline)] pub is_anchor: Option, - #[debug(no_ignore)] + #[debug(no_skip)] pub texts: Vec, - #[debug(ignore)] + #[debug(skip)] pub hidpi_scale: f32, } From a26509ee0420a3ed06568038573dd92af5164e8f Mon Sep 17 00:00:00 2001 From: Cosmic Horror Date: Wed, 22 Nov 2023 23:22:11 -0700 Subject: [PATCH 24/26] Update `resvg` & co. --- Cargo.lock | 121 +++++++++++++++++++++-------------------------- Cargo.toml | 6 +-- src/image/mod.rs | 32 ++++++------- 3 files changed, 72 insertions(+), 87 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 66a0310e..3141249b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -953,9 +953,9 @@ dependencies = [ [[package]] name = "data-url" -version = "0.2.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d7439c3735f405729d52c3fbbe4de140eaf938a1fe47d227c27f8254d4302a5" +checksum = "5c297a1c74b71ae29df00c3e22dd9534821d60eb9af5a0192823fa2acea70c2a" [[package]] name = "dconf_rs" @@ -1416,15 +1416,16 @@ dependencies = [ [[package]] name = "fontdb" -version = "0.13.1" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "237ff9f0813bbfc9de836016472e0c9ae7802f174a51594607e5f4ff334cb2f5" +checksum = "020e203f177c0fb250fb19455a252e838d2bbbce1f80f25ecc42402aafa8cd38" dependencies = [ "fontconfig-parser", "log", - "memmap2 0.5.10", + "memmap2 0.8.0", "slotmap", - "ttf-parser 0.18.1", + "tinyvec", + "ttf-parser 0.19.2", ] [[package]] @@ -2061,9 +2062,9 @@ dependencies = [ [[package]] name = "imagesize" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b72ad49b554c1728b1e83254a1b1565aea4161e28dabbfa171fc15fe62299caf" +checksum = "029d73f573d8e8d63e6d5020011d3255b28c3ba85d6cf870a07184ed23de9284" [[package]] name = "indexmap" @@ -2125,7 +2126,7 @@ dependencies = [ "smart-debug", "syntect", "tempfile", - "tiny-skia 0.9.1", + "tiny-skia 0.11.2", "toml 0.7.8", "two-face", "usvg", @@ -2526,6 +2527,15 @@ dependencies = [ "libc", ] +[[package]] +name = "memmap2" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a5a03cefb0d953ec0be133036f14e109412fa594edc2f77227249db66cc3ed" +dependencies = [ + "libc", +] + [[package]] name = "memmap2" version = "0.9.0" @@ -3566,9 +3576,9 @@ dependencies = [ [[package]] name = "resvg" -version = "0.32.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "142e83d8ae8c8c639f304698a5567b229ba65caba867bf4387bbc0ae158827cf" +checksum = "cc7980f653f9a7db31acff916a262c3b78c562919263edea29bf41a056e20497" dependencies = [ "gif", "jpeg-decoder", @@ -3576,9 +3586,8 @@ dependencies = [ "pico-args", "png", "rgb", - "svgfilters", "svgtypes", - "tiny-skia 0.9.1", + "tiny-skia 0.11.2", "usvg", ] @@ -3597,19 +3606,6 @@ dependencies = [ "bytemuck", ] -[[package]] -name = "rosvgtree" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad747e7384940e7bf33b15ba433b7bad9f44c0c6d5287a67c2cb22cd1743d497" -dependencies = [ - "log", - "roxmltree", - "simplecss", - "siphasher", - "svgtypes", -] - [[package]] name = "roxmltree" version = "0.18.1" @@ -3679,17 +3675,17 @@ dependencies = [ [[package]] name = "rustybuzz" -version = "0.7.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "162bdf42e261bee271b3957691018634488084ef577dddeb6420a9684cab2a6a" +checksum = "71cd15fef9112a1f94ac64b58d1e4628192631ad6af4dc69997f995459c874e7" dependencies = [ "bitflags 1.3.2", "bytemuck", "smallvec", - "ttf-parser 0.18.1", + "ttf-parser 0.19.2", "unicode-bidi-mirroring", "unicode-ccc", - "unicode-general-category", + "unicode-properties", "unicode-script", ] @@ -4093,21 +4089,11 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" -[[package]] -name = "svgfilters" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "639abcebc15fdc2df179f37d6f5463d660c1c79cd552c12343a4600827a04bce" -dependencies = [ - "float-cmp", - "rgb", -] - [[package]] name = "svgtypes" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed4b0611e7f3277f68c0fa18e385d9e2d26923691379690039548f867cef02a7" +checksum = "d71499ff2d42f59d26edb21369a308ede691421f79ebc0f001e2b1fd3a7c9e52" dependencies = [ "kurbo", "siphasher", @@ -4287,9 +4273,9 @@ dependencies = [ [[package]] name = "tiny-skia" -version = "0.9.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce2986c82f77818c7b9144c70818fdde98db15308e329ae2f7204d767808fd3c" +checksum = "3b72a92a05db376db09fe6d50b7948d106011761c05a6a45e23e17ee9b556222" dependencies = [ "arrayref", "arrayvec", @@ -4297,7 +4283,7 @@ dependencies = [ "cfg-if", "log", "png", - "tiny-skia-path 0.9.0", + "tiny-skia-path 0.11.2", ] [[package]] @@ -4313,9 +4299,9 @@ dependencies = [ [[package]] name = "tiny-skia-path" -version = "0.9.0" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7acb0ccda1ac91084353a56d0b69b0e29c311fd809d2088b1ed2f9ae1841c47" +checksum = "6ac3865b9708fc7e1961a65c3a4fa55e984272f33092d3c859929f887fceb647" dependencies = [ "arrayref", "bytemuck", @@ -4480,9 +4466,9 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "ttf-parser" -version = "0.18.1" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0609f771ad9c6155384897e1df4d948e692667cc0588548b68eb44d052b27633" +checksum = "49d64318d8311fc2668e48b63969f4343e0a85c4a109aa8460d6672e364b8bd1" [[package]] name = "ttf-parser" @@ -4552,12 +4538,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc2520efa644f8268dce4dcd3050eaa7fc044fca03961e9998ac7e2e92b77cf1" -[[package]] -name = "unicode-general-category" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2281c8c1d221438e373249e065ca4989c4c36952c211ff21a0ee91c44a3869e7" - [[package]] name = "unicode-ident" version = "1.0.12" @@ -4573,6 +4553,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-properties" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7f91c8b21fbbaa18853c3d0801c78f4fc94cdb976699bb03e832e75f7fd22f0" + [[package]] name = "unicode-script" version = "0.5.5" @@ -4617,9 +4603,9 @@ dependencies = [ [[package]] name = "usvg" -version = "0.32.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b44e14b7678bcc5947b397991432d0c4e02a103958a0ed5e1b9b961ddd08b21" +checksum = "c51daa774fe9ee5efcf7b4fec13019b8119cda764d9a8b5b06df02bb1445c656" dependencies = [ "base64 0.21.5", "log", @@ -4632,28 +4618,29 @@ dependencies = [ [[package]] name = "usvg-parser" -version = "0.32.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90c8251d965c2882a636ffcc054340b1f13a6bce68779cb5b2084d8ffc2535be" +checksum = "45c88a5ffaa338f0e978ecf3d4e00d8f9f493e29bed0752e1a808a1db16afc40" dependencies = [ "data-url", "flate2", "imagesize", "kurbo", "log", - "rosvgtree", - "strict-num", + "roxmltree", + "simplecss", + "siphasher", "svgtypes", "usvg-tree", ] [[package]] name = "usvg-text-layout" -version = "0.32.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c4fed019d1af07bfe0f3bac13d120d7b51bc65b38cb24809cf4ed0b8b631138" +checksum = "4d2374378cb7a3fb8f33894e0fdb8625e1bbc4f25312db8d91f862130b541593" dependencies = [ - "fontdb 0.13.1", + "fontdb 0.15.0", "kurbo", "log", "rustybuzz", @@ -4665,14 +4652,14 @@ dependencies = [ [[package]] name = "usvg-tree" -version = "0.32.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7371265c467cdae0ccc3655e2e3f310c695fb9f717c0d25187bf3b333f7b5159" +checksum = "6cacb0c5edeaf3e80e5afcf5b0d4004cc1d36318befc9a7c6606507e5d0f4062" dependencies = [ - "kurbo", "rctree", "strict-num", "svgtypes", + "tiny-skia-path 0.11.2", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index f5430764..ab58dc28 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,9 +23,9 @@ html5ever = "0.26.0" image = "0.24.7" clap = { version = "4.3.24", features = ["cargo"] } copypasta = "0.10.0" -resvg = "0.32.0" -usvg = "0.32.0" -tiny-skia = "0.9.1" +resvg = "0.36" +usvg = "0.36" +tiny-skia = "0.11" anyhow = "1.0.75" dirs = "5.0.1" serde = { version = "1.0.193", features = ["derive"] } diff --git a/src/image/mod.rs b/src/image/mod.rs index 48adbc72..d436d934 100644 --- a/src/image/mod.rs +++ b/src/image/mod.rs @@ -208,25 +208,23 @@ impl Image { image } else { let opt = usvg::Options::default(); - let mut rtree = usvg::Tree::from_data(&image_data, &opt).unwrap(); let mut fontdb = usvg::fontdb::Database::new(); fontdb.load_system_fonts(); - rtree.convert_text(&fontdb); - let pixmap_size = rtree.size.to_screen_size(); - let mut pixmap = tiny_skia::Pixmap::new( - (pixmap_size.width() as f32 * hidpi_scale) as u32, - (pixmap_size.height() as f32 * hidpi_scale) as u32, - ) - .context("Couldn't create svg pixmap") - .unwrap(); - resvg::render( - &rtree, - resvg::FitTo::Zoom(hidpi_scale), - tiny_skia::Transform::default(), - pixmap.as_mut(), - ) - .context("Svg failed to render") - .unwrap(); + let mut tree = usvg::Tree::from_data(&image_data, &opt).unwrap(); + tree.size = tree.size.scale_to( + tiny_skia::Size::from_wh( + tree.size.width() * hidpi_scale, + tree.size.height() * hidpi_scale, + ) + .unwrap(), + ); + tree.convert_text(&fontdb); + let rtree = resvg::Tree::from_usvg(&tree); + let mut pixmap = + tiny_skia::Pixmap::new(rtree.size.width() as u32, rtree.size.height() as u32) + .context("Couldn't create svg pixmap") + .unwrap(); + rtree.render(tiny_skia::Transform::default(), &mut pixmap.as_mut()); ImageData::new( ImageBuffer::from_raw(pixmap.width(), pixmap.height(), pixmap.data().into()) .context("Svg buffer has invalid dimensions") From 5f4fffd0dc2310d49e12f02d03abd01f815816d7 Mon Sep 17 00:00:00 2001 From: Cosmic Horror Date: Wed, 22 Nov 2023 23:50:52 -0700 Subject: [PATCH 25/26] Update `rust-version` to v1.70.0 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index ab58dc28..4fbff911 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT" readme = "README.md" repository = "https://github.com/trimental/inlyne" homepage = "https://github.com/trimental/inlyne" -rust-version = "1.65" +rust-version = "1.70" keywords = ["markdown", "viewer", "gpu"] [dependencies] From f7462e5b09d9bb7ebe187bf922a33b509459a2df Mon Sep 17 00:00:00 2001 From: Cosmic Horror Date: Wed, 22 Nov 2023 23:55:01 -0700 Subject: [PATCH 26/26] Bump version to v0.3.2 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3141249b..37416e56 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2094,7 +2094,7 @@ checksum = "64e9829a50b42bb782c1df523f78d332fe371b10c661e78b7a3c34b0198e9fac" [[package]] name = "inlyne" -version = "0.3.2-alpha" +version = "0.3.2" dependencies = [ "anyhow", "bytemuck", diff --git a/Cargo.toml b/Cargo.toml index 4fbff911..e1932f68 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "inlyne" -version = "0.3.2-alpha" +version = "0.3.2" description = "Introducing Inlyne, a GPU powered yet browserless tool to help you quickly view markdown files in the blink of an eye." edition = "2021" authors = ["trimental"]