Skip to content

Commit

Permalink
refactor: 🚨 修复clippy「无用转换」的编译警告;合并两处原先分离的use语句
Browse files Browse the repository at this point in the history
  • Loading branch information
ARCJ137442 committed Sep 12, 2024
1 parent c5c3227 commit 89e6f99
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/cin_implements/nars_python/translators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ pub fn output_translate(content: String) -> Result<Output> {
},
"exe" => Output::EXE {
// TODO: 有待捕获转译
operation: Operation::new("UNKNOWN", [].into_iter()),
operation: Operation::new("UNKNOWN", []),
content_raw: content,
},
"err" | "error" => Output::ERROR {
Expand Down
5 changes: 2 additions & 3 deletions src/cin_implements/openjunars/translators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> {
Expand Down Expand Up @@ -57,7 +56,7 @@ pub fn output_translate(content: String) -> Result<Output> {
},
"exe" => Output::EXE {
// TODO: 有待捕获转译
operation: Operation::new("UNKNOWN", [].into_iter()),
operation: Operation::new("UNKNOWN", []),
content_raw: content,
},
"err" | "error" => Output::ERROR {
Expand Down
3 changes: 1 addition & 2 deletions src/test_tools/nal_format/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand All @@ -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)] // ! ↓ 必须从项目根目录开始
Expand Down

0 comments on commit 89e6f99

Please sign in to comment.