Skip to content

Commit b4b9523

Browse files
committed
[Rust] Updated dependencies
1 parent 122083b commit b4b9523

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
lines changed

src/Fable.Transforms/Rust/Fable2Rust.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ module TypeInfo =
362362
[ ty ] |> makeImportType com ctx "Native" "Arc"
363363

364364
let makeBoxTy com ctx (ty: Rust.Ty) : Rust.Ty =
365-
[ ty ] |> makeImportType com ctx "Native" "Box"
365+
[ ty ] |> makeImportType com ctx "Native" (rawIdent "Box")
366366

367367
let makeMutTy com ctx (ty: Rust.Ty) : Rust.Ty =
368368
[ ty ] |> makeImportType com ctx "Native" "MutCell"
@@ -1511,7 +1511,7 @@ module Util =
15111511
[ value ] |> makeNew com ctx "Native" "Arc"
15121512

15131513
let makeBoxValue com ctx (value: Rust.Expr) =
1514-
[ value ] |> makeNew com ctx "Native" "Box"
1514+
[ value ] |> makeNew com ctx "Native" (rawIdent "Box")
15151515

15161516
let makeMutValue com ctx (value: Rust.Expr) =
15171517
[ value ] |> makeNew com ctx "Native" "MutCell"

src/fable-library-rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ default = ["bigint", "datetime", "decimal", "enum_func", "enum_string", "guid",
2222
chrono = { version = "0.4", optional = true }
2323
futures = { version = "0.3", features = ["executor", "thread-pool"], default-features = false, optional = true }
2424
futures-timer = { version = "3.0", optional = true }
25-
hashbrown = { version = "0.14", optional = true }
25+
hashbrown = { version = "0.15", optional = true }
2626
num-bigint = { version = "0.4", optional = true }
2727
num-integer = { version = "0.1", optional = true }
2828
num-traits = { version = "0.2", optional = true }

src/fable-library-rust/src/Exception.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
pub mod Exception_ {
2-
use crate::Native_::{Any, Box_, Func0, LrcPtr};
2+
use crate::Native_::{Any, Box, Func0, LrcPtr};
33
use crate::String_::{fromSlice, string};
44
use crate::System::Exception;
55
use crate::Util_::new_Exception;

src/fable-library-rust/src/Native.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub mod Native_ {
1010

1111
// re-export at module level
1212
// pub use alloc::borrow::Cow;
13-
pub use alloc::boxed::Box as Box_;
13+
pub use alloc::boxed::Box;
1414
pub use alloc::rc::Rc;
1515
pub use alloc::string::{String, ToString};
1616
pub use alloc::sync::Arc;
@@ -111,7 +111,7 @@ pub mod Native_ {
111111

112112
pub fn getHashCode<T: Hash>(x: T) -> i32 {
113113
#[cfg(feature = "no_std")]
114-
let mut hasher = hashbrown::hash_map::DefaultHashBuilder::default().build_hasher();
114+
let mut hasher = hashbrown::DefaultHashBuilder::default().build_hasher();
115115
#[cfg(not(feature = "no_std"))]
116116
let mut hasher = std::collections::hash_map::DefaultHasher::new();
117117
x.hash(&mut hasher);
@@ -163,6 +163,15 @@ pub mod Native_ {
163163
)
164164
}
165165

166+
#[cfg(feature = "no_std")]
167+
pub fn get_args(argc: isize, argv: *const *const u8) -> impl Iterator<Item = &'static str> {
168+
(0..argc as usize).map(move |i| unsafe {
169+
let curr_argv = argv.add(i).read_volatile();
170+
let c_str = core::ffi::CStr::from_ptr(curr_argv as *const _);
171+
c_str.to_str().unwrap()
172+
})
173+
}
174+
166175
// -----------------------------------------------------------
167176
// IEqualityComparer key wrapper
168177
// -----------------------------------------------------------

tests/Rust/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ edition = "2021"
77
no_std = ["fable_library_rust/no_std"]
88
static_do_bindings = ["fable_library_rust/static_do_bindings"]
99
threaded = ["fable_library_rust/threaded"]
10-
# default = ["threaded"] # Uncomment when attempting to debug/use rust analyzer to switch to threaded mode
10+
# default = ["no_std"] # Uncomment to default to "no_std" mode
11+
# default = ["threaded"] # Uncomment to default to "threaded" mode
1112

1213
[dependencies]
1314
fable_library_rust = { path = "./fable_modules/fable-library-rust" }

0 commit comments

Comments
 (0)