update dependencies
This commit is contained in:
parent
cb6a773659
commit
7e1fe54d59
979
Cargo.lock
generated
979
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
10
build.rs
10
build.rs
@ -28,6 +28,16 @@ fn font_stripper(from: &str, out: &str, unicodes: Vec<char>) -> Result<Vec<u8>,
|
|||||||
.collect::<Vec<String>>()
|
.collect::<Vec<String>>()
|
||||||
.join(",");
|
.join(",");
|
||||||
|
|
||||||
|
let pyftsubset_detect = run_script::run("whereis pyftsubset", &(vec![]), &ScriptOptions::new());
|
||||||
|
match pyftsubset_detect {
|
||||||
|
Ok((_i, s1, _s2)) => {
|
||||||
|
if s1 == "pyftsubset: " {
|
||||||
|
return Err(String::from("pyftsubset not found"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Err(x) => return Err(x.to_string()),
|
||||||
|
}
|
||||||
|
|
||||||
let script_result = run_script::run(
|
let script_result = run_script::run(
|
||||||
&format!(
|
&format!(
|
||||||
"pyftsubset {}/assets/{} --unicodes={}
|
"pyftsubset {}/assets/{} --unicodes={}
|
||||||
|
|||||||
@ -10,13 +10,13 @@ description = "Parsing library for YTBN-Graphing-Software"
|
|||||||
[lib]
|
[lib]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
phf = { version = "0.11", no-default-features = true }
|
phf = { version = "0.11" }
|
||||||
exmex = { git = "https://github.com/bertiqwerty/exmex.git", branch = "main", features = [
|
exmex = { git = "https://github.com/bertiqwerty/exmex.git", branch = "main", features = [
|
||||||
"partial",
|
"partial",
|
||||||
] }
|
] }
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
phf_codegen = { version = "0.11", no-default-features = true }
|
phf_codegen = { version = "0.11" }
|
||||||
|
|
||||||
[package.metadata.cargo-all-features]
|
[package.metadata.cargo-all-features]
|
||||||
skip_optional_dependencies = true #don't test optional dependencies, only features
|
skip_optional_dependencies = true #don't test optional dependencies, only features
|
||||||
|
|||||||
@ -34,7 +34,7 @@ impl<'a> const Default for AutoComplete<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> AutoComplete<'a> {
|
impl<'a> AutoComplete<'a> {
|
||||||
const EMPTY: AutoComplete<'a> = Self {
|
pub const EMPTY: AutoComplete<'a> = Self {
|
||||||
i: 0,
|
i: 0,
|
||||||
hint: &HINT_EMPTY,
|
hint: &HINT_EMPTY,
|
||||||
string: String::new(),
|
string: String::new(),
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
#![feature(const_trait_impl)]
|
#![feature(const_trait_impl)]
|
||||||
#![feature(core_intrinsics)]
|
#![feature(core_intrinsics)]
|
||||||
#![feature(const_default_impls)]
|
|
||||||
#![feature(const_mut_refs)]
|
#![feature(const_mut_refs)]
|
||||||
#![feature(const_for)]
|
#![feature(const_for)]
|
||||||
mod autocomplete;
|
mod autocomplete;
|
||||||
|
|||||||
@ -11,7 +11,7 @@ pub const BUILD_INFO: &str = formatc!(
|
|||||||
&build::BUILD_TIME,
|
&build::BUILD_TIME,
|
||||||
&build::PKG_VERSION,
|
&build::PKG_VERSION,
|
||||||
&build::RUST_CHANNEL,
|
&build::RUST_CHANNEL,
|
||||||
&build::RUST_VERSION[6..],
|
&build::RUST_VERSION,
|
||||||
);
|
);
|
||||||
|
|
||||||
pub const FONT_SIZE: f32 = 14.0;
|
pub const FONT_SIZE: f32 = 14.0;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
use crate::math_app::AppSettings;
|
use crate::math_app::AppSettings;
|
||||||
use crate::misc::*;
|
use crate::misc::{newtons_method_helper, step_helper, EguiHelper};
|
||||||
use egui::{
|
use egui::{
|
||||||
plot::{BarChart, PlotPoint, PlotUi},
|
plot::{BarChart, PlotPoint, PlotUi},
|
||||||
widgets::plot::Bar,
|
widgets::plot::Bar,
|
||||||
@ -139,7 +139,7 @@ impl FunctionEntry {
|
|||||||
extrema_data: Vec::new(),
|
extrema_data: Vec::new(),
|
||||||
root_data: Vec::new(),
|
root_data: Vec::new(),
|
||||||
nth_derivative_data: None,
|
nth_derivative_data: None,
|
||||||
autocomplete: AutoComplete::default(),
|
autocomplete: AutoComplete::EMPTY,
|
||||||
test_result: None,
|
test_result: None,
|
||||||
curr_nth: 3,
|
curr_nth: 3,
|
||||||
settings_opened: false,
|
settings_opened: false,
|
||||||
|
|||||||
@ -2,8 +2,6 @@
|
|||||||
#![feature(let_chains)]
|
#![feature(let_chains)]
|
||||||
#![feature(const_trait_impl)]
|
#![feature(const_trait_impl)]
|
||||||
#![feature(core_intrinsics)]
|
#![feature(core_intrinsics)]
|
||||||
#![feature(const_convert)]
|
|
||||||
#![feature(const_default_impls)]
|
|
||||||
#![feature(const_fn_floating_point_arithmetic)]
|
#![feature(const_fn_floating_point_arithmetic)]
|
||||||
#![feature(const_assume)]
|
#![feature(const_assume)]
|
||||||
#![feature(const_option_ext)]
|
#![feature(const_option_ext)]
|
||||||
@ -27,14 +25,14 @@ pub use crate::{
|
|||||||
function_entry::{FunctionEntry, Riemann},
|
function_entry::{FunctionEntry, Riemann},
|
||||||
math_app::AppSettings,
|
math_app::AppSettings,
|
||||||
misc::{
|
misc::{
|
||||||
|
// decimal_round,
|
||||||
|
hashed_storage_create,
|
||||||
hashed_storage_read,
|
hashed_storage_read,
|
||||||
newtons_method,
|
newtons_method,
|
||||||
option_vec_printer,
|
option_vec_printer,
|
||||||
step_helper,
|
step_helper,
|
||||||
EguiHelper,
|
EguiHelper,
|
||||||
// decimal_round,
|
HashBytes,
|
||||||
// hashed_storage_create,
|
|
||||||
HashBytesHelper,
|
|
||||||
},
|
},
|
||||||
unicode_helper::{to_chars_array, to_unicode_hash},
|
unicode_helper::{to_chars_array, to_unicode_hash},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -2,8 +2,6 @@
|
|||||||
#![feature(let_chains)]
|
#![feature(let_chains)]
|
||||||
#![feature(const_trait_impl)]
|
#![feature(const_trait_impl)]
|
||||||
#![feature(core_intrinsics)]
|
#![feature(core_intrinsics)]
|
||||||
#![feature(const_convert)]
|
|
||||||
#![feature(const_default_impls)]
|
|
||||||
#![feature(const_fn_floating_point_arithmetic)]
|
#![feature(const_fn_floating_point_arithmetic)]
|
||||||
#![feature(const_assume)]
|
#![feature(const_assume)]
|
||||||
#![feature(const_option_ext)]
|
#![feature(const_option_ext)]
|
||||||
|
|||||||
@ -1,5 +1,8 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
consts::*, function_entry::Riemann, function_manager::FunctionManager, misc::option_vec_printer,
|
consts::{build, BUILD_INFO, COLORS, DEFAULT_INTEGRAL_NUM, DEFAULT_MAX_X, DEFAULT_MIN_X},
|
||||||
|
function_entry::Riemann,
|
||||||
|
function_manager::FunctionManager,
|
||||||
|
misc::option_vec_printer,
|
||||||
};
|
};
|
||||||
use eframe::App;
|
use eframe::App;
|
||||||
use egui::{
|
use egui::{
|
||||||
@ -9,6 +12,7 @@ use egui::{
|
|||||||
use emath::{Align, Align2};
|
use emath::{Align, Align2};
|
||||||
use epaint::Rounding;
|
use epaint::Rounding;
|
||||||
use instant::Instant;
|
use instant::Instant;
|
||||||
|
use itertools::Itertools;
|
||||||
use std::{io::Read, ops::BitXorAssign};
|
use std::{io::Read, ops::BitXorAssign};
|
||||||
|
|
||||||
/// Stores current settings/state of [`MathApp`]
|
/// Stores current settings/state of [`MathApp`]
|
||||||
@ -257,7 +261,7 @@ impl MathApp {
|
|||||||
functions: FunctionManager::default(),
|
functions: FunctionManager::default(),
|
||||||
|
|
||||||
last_info: (None, None),
|
last_info: (None, None),
|
||||||
opened: const { Opened::default() },
|
opened: Opened::default(),
|
||||||
settings: AppSettings::default(),
|
settings: AppSettings::default(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -552,7 +556,7 @@ impl App for MathApp {
|
|||||||
CentralPanel::default()
|
CentralPanel::default()
|
||||||
.frame(Frame {
|
.frame(Frame {
|
||||||
inner_margin: Margin::symmetric(0.0, 0.0),
|
inner_margin: Margin::symmetric(0.0, 0.0),
|
||||||
rounding: Rounding::none(),
|
rounding: Rounding::ZERO,
|
||||||
// fill: crate::style::STYLE.window_fill(),
|
// fill: crate::style::STYLE.window_fill(),
|
||||||
fill: Color32::from_gray(27),
|
fill: Color32::from_gray(27),
|
||||||
..Frame::none()
|
..Frame::none()
|
||||||
@ -572,7 +576,7 @@ impl App for MathApp {
|
|||||||
format!("(Function #{}) {}\n", i, error.as_ref().unwrap_unchecked())
|
format!("(Function #{}) {}\n", i, error.as_ref().unwrap_unchecked())
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.collect::<String>();
|
.join("");
|
||||||
|
|
||||||
if !errors_formatted.is_empty() {
|
if !errors_formatted.is_empty() {
|
||||||
ui.centered_and_justified(|ui| {
|
ui.centered_and_justified(|ui| {
|
||||||
|
|||||||
19
src/misc.rs
19
src/misc.rs
@ -22,9 +22,7 @@ pub trait EguiHelper {
|
|||||||
impl EguiHelper for Vec<PlotPoint> {
|
impl EguiHelper for Vec<PlotPoint> {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn to_values(self) -> PlotPoints {
|
fn to_values(self) -> PlotPoints {
|
||||||
let a: Vec<[f64; 2]> =
|
PlotPoints::from(unsafe { std::mem::transmute::<Vec<PlotPoint>, Vec<[f64; 2]>>(self) })
|
||||||
unsafe { std::mem::transmute::<Vec<PlotPoint>, Vec<[f64; 2]>>(self) };
|
|
||||||
PlotPoints::from(a)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
@ -44,7 +42,7 @@ pub trait Offset {
|
|||||||
fn offset_x(self, x_offset: f32) -> Pos2;
|
fn offset_x(self, x_offset: f32) -> Pos2;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Offset for Pos2 {
|
impl const Offset for Pos2 {
|
||||||
fn offset_y(self, y_offset: f32) -> Pos2 {
|
fn offset_y(self, y_offset: f32) -> Pos2 {
|
||||||
Pos2 {
|
Pos2 {
|
||||||
x: self.x,
|
x: self.x,
|
||||||
@ -165,18 +163,13 @@ pub const HASH_LENGTH: usize = 8;
|
|||||||
/// Represents bytes used to represent hash info
|
/// Represents bytes used to represent hash info
|
||||||
pub type HashBytes = [u8; HASH_LENGTH];
|
pub type HashBytes = [u8; HASH_LENGTH];
|
||||||
|
|
||||||
pub trait HashBytesHelper {
|
#[allow(dead_code)]
|
||||||
fn hashed_storage_create(&self, data: &[u8]) -> String;
|
pub fn hashed_storage_create(hashbytes: &HashBytes, data: &[u8]) -> String {
|
||||||
}
|
unsafe { std::mem::transmute::<Vec<u8>, String>([hashbytes, data].concat()) }
|
||||||
|
|
||||||
impl HashBytesHelper for HashBytes {
|
|
||||||
fn hashed_storage_create(&self, data: &[u8]) -> String {
|
|
||||||
unsafe { std::mem::transmute::<Vec<u8>, String>([self, data].concat()) }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub const fn hashed_storage_read(data: &str) -> Option<(HashBytes, &[u8])> {
|
pub fn hashed_storage_read(data: &str) -> Option<(HashBytes, &[u8])> {
|
||||||
// Make sure data is long enough to decode
|
// Make sure data is long enough to decode
|
||||||
if HASH_LENGTH >= data.len() {
|
if HASH_LENGTH >= data.len() {
|
||||||
return None;
|
return None;
|
||||||
|
|||||||
@ -4,7 +4,7 @@ use itertools::Itertools;
|
|||||||
pub fn to_unicode_hash(c: char) -> String {
|
pub fn to_unicode_hash(c: char) -> String {
|
||||||
c.escape_unicode()
|
c.escape_unicode()
|
||||||
.to_string()
|
.to_string()
|
||||||
.replace(r#"\\u{"#, "")
|
.replace(r"\\u{", "")
|
||||||
.replace(['{', '}'], "")
|
.replace(['{', '}'], "")
|
||||||
.to_uppercase()
|
.to_uppercase()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +1,8 @@
|
|||||||
use crate::misc::Offset;
|
|
||||||
use egui::{Id, InnerResponse};
|
use egui::{Id, InnerResponse};
|
||||||
|
|
||||||
/// Creates an area ontop of a widget with an y offset
|
/// Creates an area ontop of a widget with an y offset
|
||||||
pub fn widgets_ontop<R>(
|
pub fn widgets_ontop<R>(
|
||||||
ui: &mut egui::Ui, id: Id, re: &egui::Response, y_offset: f32,
|
ui: &egui::Ui, id: Id, re: &egui::Response, y_offset: f32,
|
||||||
add_contents: impl FnOnce(&mut egui::Ui) -> R,
|
add_contents: impl FnOnce(&mut egui::Ui) -> R,
|
||||||
) -> InnerResponse<R> {
|
) -> InnerResponse<R> {
|
||||||
let area = egui::Area::new(id)
|
let area = egui::Area::new(id)
|
||||||
|
|||||||
0
start-server.sh
Executable file → Normal file
0
start-server.sh
Executable file → Normal file
@ -62,7 +62,7 @@ fn option_vec_printer() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn hashed_storage() {
|
fn hashed_storage() {
|
||||||
use ytbn_graphing_software::{hashed_storage_read, HashBytesHelper};
|
use ytbn_graphing_software::{hashed_storage_create, hashed_storage_read};
|
||||||
|
|
||||||
let commit = "abcdefeg".chars().map(|c| c as u8).collect::<Vec<u8>>();
|
let commit = "abcdefeg".chars().map(|c| c as u8).collect::<Vec<u8>>();
|
||||||
let data = "really cool data"
|
let data = "really cool data"
|
||||||
@ -73,7 +73,7 @@ fn hashed_storage() {
|
|||||||
.as_slice()
|
.as_slice()
|
||||||
.try_into()
|
.try_into()
|
||||||
.expect("cannot turn into [u8; 8]");
|
.expect("cannot turn into [u8; 8]");
|
||||||
let storage = storage_tmp.hashed_storage_create(data.as_slice());
|
let storage = hashed_storage_create(&storage_tmp, data.as_slice());
|
||||||
|
|
||||||
let read = hashed_storage_read(&storage);
|
let read = hashed_storage_read(&storage);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
@ -208,6 +208,6 @@ fn to_chars_array() {
|
|||||||
use ytbn_graphing_software::to_chars_array;
|
use ytbn_graphing_software::to_chars_array;
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
to_chars_array(vec!['\u{1f31e}', '\u{2d12c}']),
|
to_chars_array(vec!['\u{1f31e}', '\u{2d12c}']),
|
||||||
r#"['\u{1f31e}', '\u{2d12c}']"#
|
r"['\u{1f31e}', '\u{2d12c}']"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@ use std::collections::HashMap;
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn hashmap_gen_test() {
|
fn hashmap_gen_test() {
|
||||||
let data = vec!["time", "text", "test"];
|
let data = ["time", "text", "test"];
|
||||||
let expect = vec![
|
let expect = vec![
|
||||||
("t", "Hint::Many(&[\"ime(\", \"ext(\", \"est(\"])"),
|
("t", "Hint::Many(&[\"ime(\", \"ext(\", \"est(\"])"),
|
||||||
("te", "Hint::Many(&[\"xt(\", \"st(\"])"),
|
("te", "Hint::Many(&[\"xt(\", \"st(\"])"),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user