Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new clippy traffic #89

Merged
merged 2 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/classic/clvm_tools/cmds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ pub fn cldb(args: &[String]) {
}

if let Some(ArgumentValue::ArgString(file, path_or_code)) = parsed_args.get("path_or_code") {
input_file = file.clone();
input_file.clone_from(file);
input_program = path_or_code.to_string();
}

Expand Down Expand Up @@ -1117,7 +1117,7 @@ pub fn launch_tool(stdout: &mut Stream, args: &[String], tool_name: &str, defaul
let mut input_program = "()".to_string();

if let Some(ArgumentValue::ArgString(file, path_or_code)) = parsed_args.get("path_or_code") {
input_file = file.clone();
input_file.clone_from(file);
input_program = path_or_code.to_string();
}

Expand Down Expand Up @@ -1179,7 +1179,7 @@ pub fn launch_tool(stdout: &mut Stream, args: &[String], tool_name: &str, defaul
}

if let Some(ArgumentValue::ArgString(file, path_or_code)) = parsed_args.get("env") {
input_file = file.clone();
input_file.clone_from(file);
input_args = path_or_code.to_string();
}

Expand Down Expand Up @@ -1244,8 +1244,8 @@ pub fn launch_tool(stdout: &mut Stream, args: &[String], tool_name: &str, defaul
if let Some(ArgumentValue::ArgString(f, content)) = parsed_args.get("path_or_code") {
match read_ir(content) {
Ok(s) => {
input_program = content.clone();
input_file = f.clone();
input_program.clone_from(content);
input_file.clone_from(f);
src_sexp = s;
}
Err(e) => {
Expand Down
2 changes: 1 addition & 1 deletion src/classic/clvm_tools/stages/stage_2/optimize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ pub fn optimize_sexp_(
}
SExp::Pair(_, _) => {
for opt in optimizers.iter() {
name = opt.name.clone();
name.clone_from(&opt.name);
match opt.invoke(allocator, memo, r, eval_f.clone()) {
Err(e) => {
return Err(e);
Expand Down
5 changes: 1 addition & 4 deletions src/classic/platform/argparse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,10 +491,7 @@ impl ArgumentParser {
}

let name = &self.optional_args[k].names[index as usize];
let index2 = match arg.find(name) {
Some(i) => i,
_ => 0,
} + name.len();
let index2 = arg.find(name).unwrap_or_default() + name.len();
let value = &arg[index2..].to_string();

norm.push(name.to_string());
Expand Down
6 changes: 4 additions & 2 deletions src/compiler/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1520,7 +1520,7 @@ fn start_codegen(
)),
};

code_generator.to_process = program.helpers.clone();
code_generator.to_process.clone_from(&program.helpers);
// Ensure that we have the synthesis of the previous codegen's helpers and
// The ones provided with the new form if any.
let mut combined_helpers_for_codegen = program.helpers.clone();
Expand Down Expand Up @@ -1716,7 +1716,9 @@ pub fn codegen(
// If stepping 23 or greater, we support no-env mode.
enable_nil_env_mode_for_stepping_23_or_greater(opts.clone(), &mut code_generator);

*context.symbols() = code_generator.function_symbols.clone();
context
.symbols()
.clone_from(&code_generator.function_symbols);
context
.symbols()
.insert("source_file".to_string(), opts.filename());
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ impl CompilerOpts for DefaultCompilerOpts {
}
fn set_search_paths(&self, dirs: &[String]) -> Rc<dyn CompilerOpts> {
let mut copy = self.clone();
copy.include_dirs = dirs.to_owned();
dirs.clone_into(&mut copy.include_dirs);
Rc::new(copy)
}
fn set_disassembly_ver(&self, ver: Option<usize>) -> Rc<dyn CompilerOpts> {
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/comptypes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,7 @@ pub fn join_vecs_to_string(sep: Vec<u8>, vecs: &[Vec<u8>]) -> String {
s.append(&mut comma.clone());
s.append(&mut elt.to_vec());
if comma.is_empty() {
comma = sep.clone();
comma.clone_from(&sep);
}
}

Expand Down
24 changes: 12 additions & 12 deletions wasm/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ path = "src/mod.rs"
[dependencies]
clvm_tools_rs = { path= "..", features = [] }
clvmr = { version = "0.3.0", features = ["pre-eval"] }
wasm-bindgen = "=0.2.83"
wasm-bindgen = "=0.2.92"
wasm-bindgen-test = "=0.3.25"
js-sys = "0.3.60"
num-bigint = "0.4.0"
Expand Down
Loading