Skip to content

Commit 2ffdf87

Browse files
committed
lint: fix clippy::default_trait_access
1 parent 91d0327 commit 2ffdf87

File tree

17 files changed

+33
-31
lines changed

17 files changed

+33
-31
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ print_stderr = "allow"
1818
dbg_macro = "warn"
1919
pedantic = {level = "warn", priority = -1}
2020
inline_always = "allow" # TODO: benchmark inlines
21-
default_trait_access = "allow" # 23
2221
format_push_string = "allow" # 27
2322
missing_panics_doc = "allow" # 37
2423
used_underscore_binding = "allow" # 39

pad/editor/src/backend.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ pub fn delete_file(path: &PathBuf) {
7070
}
7171

7272
thread_local! {
73-
static BREAKPOINTS: RefCell<HashMap<u64, (u64, usize)>> = Default::default();
7473
}
7574

7675
impl Default for WebBackend {
@@ -434,8 +433,8 @@ impl SysBackend for WebBackend {
434433
}
435434
fn load_git_module(&self, original_url: &str, target: GitTarget) -> Result<PathBuf, String> {
436435
thread_local! {
437-
static CACHE: RefCell<HashMap<String, Result<String, String>>> = Default::default();
438-
static WORKING: RefCell<HashSet<String>> = Default::default();
436+
static CACHE: RefCell<HashMap<String, Result<String, String>>> = RefCell::default();
437+
static WORKING: RefCell<HashSet<String>> = RefCell::default();
439438
}
440439

441440
fn cache_url(url: &str, res: Result<String, String>) {

pad/editor/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ pub fn Editor<'a>(
129129
let (fullscreen_enabled, set_fullscreen_enabled) = create_signal(false);
130130
let update_token_count = move |code: &str| {
131131
set_token_count.set(
132-
lex(code, (), &mut Default::default())
132+
lex(code, (), &mut uiua::Inputs::default())
133133
.0
134134
.into_iter()
135135
.filter(|tok| {

site/src/markdown.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ fn node_view<'a>(node: &'a AstNode<'a>) -> View {
182182
if block.literal.trim() == "LOGO" {
183183
view!(<Editor example=LOGO/>).into_view()
184184
} else if (block.info.is_empty() || block.info.starts_with("uiua"))
185-
&& uiua::parse(&block.literal, (), &mut Default::default())
185+
&& uiua::parse(&block.literal, (), &mut Inputs::default())
186186
.1
187187
.is_empty()
188188
{

src/algorithm/ga.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ use ecow::{eco_vec, EcoVec};
99
use serde::*;
1010

1111
use crate::{
12-
algorithm::pervade::derive_new_shape, grid_fmt::GridFmt, is_default, Array, Boxed, Primitive,
13-
Shape, Uiua, UiuaResult, Value,
12+
algorithm::pervade::derive_new_shape,
13+
grid_fmt::{GridFmt, GridFmtParams},
14+
is_default, Array, Boxed, Primitive, Shape, Uiua, UiuaResult, Value,
1415
};
1516

1617
macro_rules! ga_op {
@@ -1259,7 +1260,7 @@ pub fn unparse(spec: Spec, val: Value, env: &Uiua) -> UiuaResult<Value> {
12591260
}
12601261
let mask = mask_table[i];
12611262
if n.abs() != 1.0 || mask == 0 {
1262-
let n_grid = n.abs().fmt_grid(Default::default());
1263+
let n_grid = n.abs().fmt_grid(GridFmtParams::default());
12631264
s.extend(n_grid.into_iter().next().unwrap());
12641265
}
12651266
if mask == 0 {

src/algorithm/groups.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ use ecow::{eco_vec, EcoVec};
77

88
use crate::{
99
cowslice::CowSlice, get_ops, types::push_empty_rows_value, val_as_arr, Array, ArrayValue,
10-
Boxed, Node, Ops, Primitive, ScalarNum, Shape, SigNode, Uiua, UiuaResult, Value,
10+
Boxed, Node, Ops, PersistentMeta, Primitive, ScalarNum, Shape, SigNode, Uiua, UiuaResult,
11+
Value,
1112
};
1213

1314
use super::multi_output;
@@ -756,7 +757,7 @@ where
756757
.collect::<UiuaResult<_>>()?;
757758

758759
if indices.shape == [0]
759-
&& push_empty_rows_value(&f, &values, false, &mut Default::default(), env)
760+
&& push_empty_rows_value(&f, &values, false, &mut PersistentMeta::default(), env)
760761
{
761762
return Ok(());
762763
}

src/algorithm/media.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ pub fn gif_bytes_to_value(bytes: &[u8]) -> Result<(f64, Value), gif::DecodingErr
740740
let first_frame = decoder.read_next_frame()?.unwrap();
741741
let gif_width = first_frame.width as usize;
742742
let gif_height = first_frame.height as usize;
743-
let mut data: crate::cowslice::CowSlice<f64> = Default::default();
743+
let mut data = crate::cowslice::CowSlice::new();
744744
let mut frame_count = 1;
745745
let mut delay_sum = first_frame.delay as f64 / 100.0;
746746
// Init frame data with the first frame

src/algorithm/pervade.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use std::{
77

88
use ecow::eco_vec;
99

10+
use crate::cowslice::CowSlice;
1011
use crate::fill::FillValue;
1112
use crate::{algorithm::loops::flip, array::*, Uiua, UiuaError, UiuaResult, Value};
1213
use crate::{Complex, Shape};
@@ -636,7 +637,7 @@ where
636637

637638
if new_shape.contains(&0) {
638639
b.shape = new_shape;
639-
b.data = Default::default();
640+
b.data = CowSlice::new();
640641
} else if new_shape == b.shape {
641642
// The existing array can be used
642643
if a.shape == b.shape {

src/compile/binding.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ impl Compiler {
475475
sig,
476476
explicit: binding.signature.is_some(),
477477
inline: false,
478-
set_inverses: Default::default(),
478+
set_inverses: SetInverses::default(),
479479
},
480480
);
481481
}

src/compile/invert/un.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub fn un_inverse(input: &[Node], asm: &Assembly) -> InversionResult<Node> {
3333
}
3434

3535
thread_local! {
36-
static CACHE: RefCell<HashMap<u64, InversionResult<Node>>> = Default::default();
36+
static CACHE: RefCell<HashMap<u64, InversionResult<Node>>> = RefCell::default();
3737
}
3838
let mut hasher = DefaultHasher::new();
3939
for node in input {
@@ -95,7 +95,7 @@ fn anti_inverse(input: &[Node], asm: &Assembly, for_un: bool) -> InversionResult
9595
return generic();
9696
}
9797
thread_local! {
98-
static CACHE: RefCell<HashMap<u64, InversionResult<Node>>> = Default::default();
98+
static CACHE: RefCell<HashMap<u64, InversionResult<Node>>> = RefCell::default();
9999
}
100100
let mut hasher = DefaultHasher::new();
101101
for node in input {
@@ -436,7 +436,7 @@ inverse!(BothPat, input, asm, Both, span, [f], {
436436
let inv = f.un_inverse(asm)?;
437437
Ok((
438438
input,
439-
ImplMod(UnBothImpl(Default::default()), eco_vec![inv], span),
439+
ImplMod(UnBothImpl(Subscript::default()), eco_vec![inv], span),
440440
))
441441
});
442442

0 commit comments

Comments
 (0)