Skip to content
This repository was archived by the owner on Aug 18, 2025. It is now read-only.

Commit 90b68ae

Browse files
committed
修正GitHub工作流中的打包命令,将codenothing更名为CodeNothing,并更新库文件中对std模块的引用,统一使用绝对路径导入方式
1 parent b421a84 commit 90b68ae

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

.github/workflows/build_interpreter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
- name: 打包Linux/macOS
7676
if: matrix.os != 'windows-latest'
7777
run: |
78-
cp target/release/codenothing release-package/
78+
cp target/release/CodeNothing release-package/
7979
# 如果examples目录存在,则复制
8080
if [ -d "examples" ]; then
8181
cp -r examples release-package/

library_io/src/lib.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use ::std::collections::HashMap;
2-
use ::std::io::{self, Write};
2+
use ::std::io::{self, Write as IoWrite};
33
use ::std::fmt::Write as FmtWrite;
44

55
// 导入通用库
@@ -9,8 +9,6 @@ use cn_common::string::process_escape_chars;
99
// 命名空间函数
1010
mod std {
1111
use super::*;
12-
use ::std::fmt::Write;
13-
use ::std::io::Write;
1412

1513
// 打印字符串到标准输出
1614
pub fn cn_print(args: Vec<String>) -> String {
@@ -83,7 +81,7 @@ mod std {
8381
// 整数格式化
8482
if let Some(arg) = format_args.next() {
8583
if let Ok(num) = arg.parse::<i32>() {
86-
let _ = write!(result, "{}", num);
84+
let _ = FmtWrite::write_fmt(&mut result, format_args!("{}", num));
8785
} else {
8886
result.push_str("%d");
8987
}
@@ -96,7 +94,7 @@ mod std {
9694
// 浮点数格式化
9795
if let Some(arg) = format_args.next() {
9896
if let Ok(num) = arg.parse::<f64>() {
99-
let _ = write!(result, "{}", num);
97+
let _ = FmtWrite::write_fmt(&mut result, format_args!("{}", num));
10098
} else {
10199
result.push_str("%f");
102100
}

0 commit comments

Comments
 (0)