update dependencies
This commit is contained in:
@@ -11,7 +11,7 @@ pub const BUILD_INFO: &str = formatc!(
|
||||
&build::BUILD_TIME,
|
||||
&build::PKG_VERSION,
|
||||
&build::RUST_CHANNEL,
|
||||
&build::RUST_VERSION[6..],
|
||||
&build::RUST_VERSION,
|
||||
);
|
||||
|
||||
pub const FONT_SIZE: f32 = 14.0;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::math_app::AppSettings;
|
||||
use crate::misc::*;
|
||||
use crate::misc::{newtons_method_helper, step_helper, EguiHelper};
|
||||
use egui::{
|
||||
plot::{BarChart, PlotPoint, PlotUi},
|
||||
widgets::plot::Bar,
|
||||
@@ -139,7 +139,7 @@ impl FunctionEntry {
|
||||
extrema_data: Vec::new(),
|
||||
root_data: Vec::new(),
|
||||
nth_derivative_data: None,
|
||||
autocomplete: AutoComplete::default(),
|
||||
autocomplete: AutoComplete::EMPTY,
|
||||
test_result: None,
|
||||
curr_nth: 3,
|
||||
settings_opened: false,
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
#![feature(let_chains)]
|
||||
#![feature(const_trait_impl)]
|
||||
#![feature(core_intrinsics)]
|
||||
#![feature(const_convert)]
|
||||
#![feature(const_default_impls)]
|
||||
#![feature(const_fn_floating_point_arithmetic)]
|
||||
#![feature(const_assume)]
|
||||
#![feature(const_option_ext)]
|
||||
@@ -27,14 +25,14 @@ pub use crate::{
|
||||
function_entry::{FunctionEntry, Riemann},
|
||||
math_app::AppSettings,
|
||||
misc::{
|
||||
// decimal_round,
|
||||
hashed_storage_create,
|
||||
hashed_storage_read,
|
||||
newtons_method,
|
||||
option_vec_printer,
|
||||
step_helper,
|
||||
EguiHelper,
|
||||
// decimal_round,
|
||||
// hashed_storage_create,
|
||||
HashBytesHelper,
|
||||
HashBytes,
|
||||
},
|
||||
unicode_helper::{to_chars_array, to_unicode_hash},
|
||||
};
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
#![feature(let_chains)]
|
||||
#![feature(const_trait_impl)]
|
||||
#![feature(core_intrinsics)]
|
||||
#![feature(const_convert)]
|
||||
#![feature(const_default_impls)]
|
||||
#![feature(const_fn_floating_point_arithmetic)]
|
||||
#![feature(const_assume)]
|
||||
#![feature(const_option_ext)]
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
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 egui::{
|
||||
@@ -9,6 +12,7 @@ use egui::{
|
||||
use emath::{Align, Align2};
|
||||
use epaint::Rounding;
|
||||
use instant::Instant;
|
||||
use itertools::Itertools;
|
||||
use std::{io::Read, ops::BitXorAssign};
|
||||
|
||||
/// Stores current settings/state of [`MathApp`]
|
||||
@@ -257,7 +261,7 @@ impl MathApp {
|
||||
functions: FunctionManager::default(),
|
||||
|
||||
last_info: (None, None),
|
||||
opened: const { Opened::default() },
|
||||
opened: Opened::default(),
|
||||
settings: AppSettings::default(),
|
||||
}
|
||||
}
|
||||
@@ -552,7 +556,7 @@ impl App for MathApp {
|
||||
CentralPanel::default()
|
||||
.frame(Frame {
|
||||
inner_margin: Margin::symmetric(0.0, 0.0),
|
||||
rounding: Rounding::none(),
|
||||
rounding: Rounding::ZERO,
|
||||
// fill: crate::style::STYLE.window_fill(),
|
||||
fill: Color32::from_gray(27),
|
||||
..Frame::none()
|
||||
@@ -572,7 +576,7 @@ impl App for MathApp {
|
||||
format!("(Function #{}) {}\n", i, error.as_ref().unwrap_unchecked())
|
||||
}
|
||||
})
|
||||
.collect::<String>();
|
||||
.join("");
|
||||
|
||||
if !errors_formatted.is_empty() {
|
||||
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> {
|
||||
#[inline(always)]
|
||||
fn to_values(self) -> PlotPoints {
|
||||
let a: Vec<[f64; 2]> =
|
||||
unsafe { std::mem::transmute::<Vec<PlotPoint>, Vec<[f64; 2]>>(self) };
|
||||
PlotPoints::from(a)
|
||||
PlotPoints::from(unsafe { std::mem::transmute::<Vec<PlotPoint>, Vec<[f64; 2]>>(self) })
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
@@ -44,7 +42,7 @@ pub trait Offset {
|
||||
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 {
|
||||
Pos2 {
|
||||
x: self.x,
|
||||
@@ -165,18 +163,13 @@ pub const HASH_LENGTH: usize = 8;
|
||||
/// Represents bytes used to represent hash info
|
||||
pub type HashBytes = [u8; HASH_LENGTH];
|
||||
|
||||
pub trait HashBytesHelper {
|
||||
fn hashed_storage_create(&self, data: &[u8]) -> String;
|
||||
}
|
||||
|
||||
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)]
|
||||
pub fn hashed_storage_create(hashbytes: &HashBytes, data: &[u8]) -> String {
|
||||
unsafe { std::mem::transmute::<Vec<u8>, String>([hashbytes, data].concat()) }
|
||||
}
|
||||
|
||||
#[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
|
||||
if HASH_LENGTH >= data.len() {
|
||||
return None;
|
||||
|
||||
@@ -4,7 +4,7 @@ use itertools::Itertools;
|
||||
pub fn to_unicode_hash(c: char) -> String {
|
||||
c.escape_unicode()
|
||||
.to_string()
|
||||
.replace(r#"\\u{"#, "")
|
||||
.replace(r"\\u{", "")
|
||||
.replace(['{', '}'], "")
|
||||
.to_uppercase()
|
||||
}
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
use crate::misc::Offset;
|
||||
use egui::{Id, InnerResponse};
|
||||
|
||||
/// Creates an area ontop of a widget with an y offset
|
||||
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,
|
||||
) -> InnerResponse<R> {
|
||||
let area = egui::Area::new(id)
|
||||
|
||||
Reference in New Issue
Block a user