summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbernard <[email protected]>2025-12-13 21:42:29 +0800
committerR b b666 <[email protected]>2025-12-15 12:50:49 +0800
commit4f154d8207be7320be07477fe3857523b1704977 (patch)
treed32fa76e74dccef9a58c7b5d54d10a2f4f54c4d6
parent3c459aecea7135f96d9ebd291d276a6e18fd97c7 (diff)
[rust] Tidy core defaults and migrate docs to README
-rw-r--r--components/rust/README_zh.md (renamed from components/rust/README_cn.md)0
-rw-r--r--components/rust/core/src/api/libloading.rs2
-rw-r--r--components/rust/core/src/lib.rs2
-rw-r--r--components/rust/core/src/panic.rs2
-rw-r--r--components/rust/core/src/thread.rs4
-rw-r--r--components/rust/docs/1.tools/README.md (renamed from components/rust/docs/1.tools/tools.md)0
-rw-r--r--components/rust/docs/1.tools/README_zh.md (renamed from components/rust/docs/1.tools/tools_cn.md)0
-rw-r--r--components/rust/docs/2.applications/README.md (renamed from components/rust/docs/2.applications/application.md)0
-rw-r--r--components/rust/docs/2.applications/README_zh.md (renamed from components/rust/docs/2.applications/application_cn.md)0
-rw-r--r--components/rust/docs/3.components/README.md (renamed from components/rust/docs/3.components/component.md)0
-rw-r--r--components/rust/docs/3.components/README_zh.md (renamed from components/rust/docs/3.components/component_cn.md)0
-rw-r--r--components/rust/docs/4.modules/README.md (renamed from components/rust/docs/4.modules/modules.md)0
-rw-r--r--components/rust/docs/4.modules/README_zh.md (renamed from components/rust/docs/4.modules/modules_cn.md)0
-rw-r--r--components/rust/docs/5.rt-macro/README.md (renamed from components/rust/docs/5.rt-macro/rt-macros.md)0
-rw-r--r--components/rust/docs/5.rt-macro/README_zh.md (renamed from components/rust/docs/5.rt-macro/rt-macros_cn.md)0
-rw-r--r--components/rust/examples/modules/example_lib/src/lib.rs6
16 files changed, 8 insertions, 8 deletions
diff --git a/components/rust/README_cn.md b/components/rust/README_zh.md
index fbed3259cb..fbed3259cb 100644
--- a/components/rust/README_cn.md
+++ b/components/rust/README_zh.md
diff --git a/components/rust/core/src/api/libloading.rs b/components/rust/core/src/api/libloading.rs
index 438f1fb40b..90b33cc92d 100644
--- a/components/rust/core/src/api/libloading.rs
+++ b/components/rust/core/src/api/libloading.rs
@@ -150,7 +150,7 @@ impl Library {
let h = self.handle;
forget(self);
let rc = libc::dlclose(h);
- if rc == 1 {
+ if rc == 0 {
Ok(())
} else {
Err(DlError::Close(rc))
diff --git a/components/rust/core/src/lib.rs b/components/rust/core/src/lib.rs
index 2787b7240a..01e4b34102 100644
--- a/components/rust/core/src/lib.rs
+++ b/components/rust/core/src/lib.rs
@@ -77,7 +77,7 @@ pub enum RTTError {
FileSetLengthErr,
FileSyncErr,
- FuncUnDefine,
+ FuncUndefined,
}
pub type RTResult<T> = Result<T, RTTError>;
diff --git a/components/rust/core/src/panic.rs b/components/rust/core/src/panic.rs
index 371f86fdb6..b45ad7d1a3 100644
--- a/components/rust/core/src/panic.rs
+++ b/components/rust/core/src/panic.rs
@@ -24,7 +24,7 @@ fn panic(info: &core::panic::PanicInfo) -> ! {
}
#[linkage = "weak"]
-#[unsafe(no_mangle)]
+#[no_mangle]
fn __rust_panic() -> ! {
/* Default weak panic handler: loops forever to halt execution. */
print!("Entered weak panic handler: system will halt.");
diff --git a/components/rust/core/src/thread.rs b/components/rust/core/src/thread.rs
index 35e03f3c3a..791fd46da7 100644
--- a/components/rust/core/src/thread.rs
+++ b/components/rust/core/src/thread.rs
@@ -28,7 +28,7 @@ impl Thread {
pub fn new() -> ThreadBuilder {
ThreadBuilder {
- th_name: "uname".into(),
+ th_name: "Unnamed".into(),
th_stack_size: 4096,
th_priority: 10,
th_ticks: 10,
@@ -151,4 +151,4 @@ impl ThreadBuilder {
func,
)
}
-} \ No newline at end of file
+}
diff --git a/components/rust/docs/1.tools/tools.md b/components/rust/docs/1.tools/README.md
index 8e015ef445..8e015ef445 100644
--- a/components/rust/docs/1.tools/tools.md
+++ b/components/rust/docs/1.tools/README.md
diff --git a/components/rust/docs/1.tools/tools_cn.md b/components/rust/docs/1.tools/README_zh.md
index 9ca28c2d87..9ca28c2d87 100644
--- a/components/rust/docs/1.tools/tools_cn.md
+++ b/components/rust/docs/1.tools/README_zh.md
diff --git a/components/rust/docs/2.applications/application.md b/components/rust/docs/2.applications/README.md
index f393bf1e20..f393bf1e20 100644
--- a/components/rust/docs/2.applications/application.md
+++ b/components/rust/docs/2.applications/README.md
diff --git a/components/rust/docs/2.applications/application_cn.md b/components/rust/docs/2.applications/README_zh.md
index d2f1568fb3..d2f1568fb3 100644
--- a/components/rust/docs/2.applications/application_cn.md
+++ b/components/rust/docs/2.applications/README_zh.md
diff --git a/components/rust/docs/3.components/component.md b/components/rust/docs/3.components/README.md
index df1f7126ee..df1f7126ee 100644
--- a/components/rust/docs/3.components/component.md
+++ b/components/rust/docs/3.components/README.md
diff --git a/components/rust/docs/3.components/component_cn.md b/components/rust/docs/3.components/README_zh.md
index ff48fc859a..ff48fc859a 100644
--- a/components/rust/docs/3.components/component_cn.md
+++ b/components/rust/docs/3.components/README_zh.md
diff --git a/components/rust/docs/4.modules/modules.md b/components/rust/docs/4.modules/README.md
index 501a27215d..501a27215d 100644
--- a/components/rust/docs/4.modules/modules.md
+++ b/components/rust/docs/4.modules/README.md
diff --git a/components/rust/docs/4.modules/modules_cn.md b/components/rust/docs/4.modules/README_zh.md
index f9630d31ad..f9630d31ad 100644
--- a/components/rust/docs/4.modules/modules_cn.md
+++ b/components/rust/docs/4.modules/README_zh.md
diff --git a/components/rust/docs/5.rt-macro/rt-macros.md b/components/rust/docs/5.rt-macro/README.md
index 3f448d77fc..3f448d77fc 100644
--- a/components/rust/docs/5.rt-macro/rt-macros.md
+++ b/components/rust/docs/5.rt-macro/README.md
diff --git a/components/rust/docs/5.rt-macro/rt-macros_cn.md b/components/rust/docs/5.rt-macro/README_zh.md
index e631fda184..e631fda184 100644
--- a/components/rust/docs/5.rt-macro/rt-macros_cn.md
+++ b/components/rust/docs/5.rt-macro/README_zh.md
diff --git a/components/rust/examples/modules/example_lib/src/lib.rs b/components/rust/examples/modules/example_lib/src/lib.rs
index 5f81c1553f..79fe384e6a 100644
--- a/components/rust/examples/modules/example_lib/src/lib.rs
+++ b/components/rust/examples/modules/example_lib/src/lib.rs
@@ -11,7 +11,7 @@
/* Bring rt-rust's println! macro into scope */
use rt_rust::println;
use core::ffi::{c_char, CStr};
-#[unsafe(no_mangle)]
+#[no_mangle]
pub extern "C" fn rust_mylib_println(s: *const c_char) {
if s.is_null() {
println!("");
@@ -24,7 +24,7 @@ pub extern "C" fn rust_mylib_println(s: *const c_char) {
}
}
-#[unsafe(no_mangle)]
+#[no_mangle]
pub extern "C" fn rust_mylib_add(a: usize, b: usize) -> usize {
a + b
-} \ No newline at end of file
+}