From 89e6f992469f88234eba2d18b4953c6b8ada3ac9 Mon Sep 17 00:00:00 2001 From: ARCJ137442 <61109168+ARCJ137442@users.noreply.github.com> Date: Thu, 12 Sep 2024 15:15:27 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20:rotating=5Flight:=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8Dclippy=E3=80=8C=E6=97=A0=E7=94=A8=E8=BD=AC=E6=8D=A2?= =?UTF-8?q?=E3=80=8D=E7=9A=84=E7=BC=96=E8=AF=91=E8=AD=A6=E5=91=8A=EF=BC=9B?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E4=B8=A4=E5=A4=84=E5=8E=9F=E5=85=88=E5=88=86?= =?UTF-8?q?=E7=A6=BB=E7=9A=84`use`=E8=AF=AD=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cin_implements/nars_python/translators.rs | 2 +- src/cin_implements/openjunars/translators.rs | 5 ++--- src/test_tools/nal_format/mod.rs | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/cin_implements/nars_python/translators.rs b/src/cin_implements/nars_python/translators.rs index 9e396a2..98b3df5 100644 --- a/src/cin_implements/nars_python/translators.rs +++ b/src/cin_implements/nars_python/translators.rs @@ -66,7 +66,7 @@ pub fn output_translate(content: String) -> Result { }, "exe" => Output::EXE { // TODO: 有待捕获转译 - operation: Operation::new("UNKNOWN", [].into_iter()), + operation: Operation::new("UNKNOWN", []), content_raw: content, }, "err" | "error" => Output::ERROR { diff --git a/src/cin_implements/openjunars/translators.rs b/src/cin_implements/openjunars/translators.rs index 1a25206..87054db 100644 --- a/src/cin_implements/openjunars/translators.rs +++ b/src/cin_implements/openjunars/translators.rs @@ -5,14 +5,13 @@ //! //! TODO: 🚧自OpenNARS复制而来,一些地方需要特别适配 +use crate::runtimes::TranslateError; use anyhow::Result; use navm::{ cmd::Cmd, output::{Operation, Output}, }; -use crate::runtimes::TranslateError; - /// OpenJunars的「输入转译」函数 /// * 🎯用于将统一的「NAVM指令」转译为「OpenJunars Shell输入」 pub fn input_translate(cmd: Cmd) -> Result { @@ -57,7 +56,7 @@ pub fn output_translate(content: String) -> Result { }, "exe" => Output::EXE { // TODO: 有待捕获转译 - operation: Operation::new("UNKNOWN", [].into_iter()), + operation: Operation::new("UNKNOWN", []), content_raw: content, }, "err" | "error" => Output::ERROR { diff --git a/src/test_tools/nal_format/mod.rs b/src/test_tools/nal_format/mod.rs index 6212357..6be607a 100644 --- a/src/test_tools/nal_format/mod.rs +++ b/src/test_tools/nal_format/mod.rs @@ -3,8 +3,6 @@ //! * 🎯提供一种(部分)兼容现有`.nal`格式文件的语法 //! * ⚠️对其中所有Narsese部分使用CommonNarsese「通用纳思语」:不兼容方言 -use std::{result::Result::Err as StdErr, result::Result::Ok as StdOk, time::Duration}; - use super::structs::*; use anyhow::{Ok, Result}; use narsese::{ @@ -14,6 +12,7 @@ use narsese::{ use navm::{cmd::Cmd, output::Operation}; use pest::{iterators::Pair, Parser}; use pest_derive::Parser; +use std::{result::Result::Err as StdErr, result::Result::Ok as StdOk, time::Duration}; use util::{first, pipe}; #[derive(Parser)] // ! ↓ 必须从项目根目录开始