diff --git a/archived/rustry/examples/future_input.rs b/archived/rustry/examples/future_input.rs index 3f8ac5f..426ec32 100644 --- a/archived/rustry/examples/future_input.rs +++ b/archived/rustry/examples/future_input.rs @@ -43,7 +43,7 @@ fn read_line() -> io::Result { let input = io::stdin(); let mut locked = input.lock(); - let mut buf = String::new(); + let mut buf = String::default(); match locked.read_line(&mut buf) { Ok(_) => Ok(buf), diff --git a/yard-rs/lists/src/list01.rs b/yard-rs/lists/src/list01.rs index 1ac0be4..eab9b9e 100644 --- a/yard-rs/lists/src/list01.rs +++ b/yard-rs/lists/src/list01.rs @@ -23,7 +23,7 @@ impl List { pub fn push(&mut self, elem: i32) { let new_node = Box::new(Node { - elem: elem, + elem, next: mem::replace(&mut self.head, Link::Empty), }); diff --git a/yard-rs/lists/src/list02.rs b/yard-rs/lists/src/list02.rs index f0b3114..3e3acfd 100644 --- a/yard-rs/lists/src/list02.rs +++ b/yard-rs/lists/src/list02.rs @@ -18,7 +18,7 @@ impl List { pub fn push(&mut self, elem: T) { let new_node = Box::new(Node { - elem: elem, + elem, next: self.head.take(), }); diff --git a/yard-rs/runpod-xp/run.py b/yard-rs/runpod-xp/run.py index f87c10e..5ab92d6 100644 --- a/yard-rs/runpod-xp/run.py +++ b/yard-rs/runpod-xp/run.py @@ -136,7 +136,7 @@ def run( if runpod_cfg.debug: os.environ["RUNPOD_DEBUG"] = 'true' - logging.info(f"Debug mode enabled") + logging.info("Debug mode enabled") try: if runpod_cfg.pod_type == 'INTERRUPTABLE': @@ -187,7 +187,7 @@ def run( log_error(f"Failed to create pod for {config}") return - def signal_handler(signal, frame): + def signal_handler(_signal, _frame): logging.info(f"Keyboard interrupt received, terminating pod {pod['id']}") terminate(pod) sys.exit(0) @@ -208,9 +208,9 @@ def signal_handler(signal, frame): eta = CUSTOM_RUNPOD_IMAGE_SIZE * BITS_PER_BYTE / pod_info['machine']['maxDownloadSpeedMbps'] + CUSTOM_RUNPOD_IMAGE_SIZE / COMPRESSION_RATIO / pod_info['machine']['diskMBps'] - logging.info(f" - Estimated time to download and extrace the image: {eta} seconds") - logging.info(f" - While you're waiting, you can check the status of the pod at https://www.runpod.io/console/pods ") - logging.info(f" - After started, use the following command to ssh into the pod: {ssh_command}") + logging.info(" - Estimated time to download and extrace the image: {eta} seconds") + logging.info(" - While you're waiting, you can check the status of the pod at https://www.runpod.io/console/pods ") + logging.info(" - After started, use the following command to ssh into the pod: {ssh_command}") # logging.info(f" or the following command in CodeSpace: {codespace_ssh_command}") runtime = None diff --git a/yard-rs/rust_basics/examples/stdin.rs b/yard-rs/rust_basics/examples/stdin.rs index 1e67ab1..5703940 100644 --- a/yard-rs/rust_basics/examples/stdin.rs +++ b/yard-rs/rust_basics/examples/stdin.rs @@ -1,8 +1,8 @@ use std::io; fn main() { - let mut input = String::new(); - io::stdin().read_line(&mut input).ok().unwrap_or_default(); + let mut input = String::default(); + io::stdin().read_line(&mut input).unwrap_or_default(); println!( "{}", input