Skip to content

Commit b8ba6ea

Browse files
committed
🐛 fix: hash_map_macro reverted
See <rust-lang/rust#148049>
1 parent fa6b13c commit b8ba6ea

File tree

4 files changed

+24
-19
lines changed

4 files changed

+24
-19
lines changed

scripts/init-branch.nu

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44
source ./check.nu
55

66
def main [] {
7-
let branches_and_paths = open ./scripts/branches.json | transpose name features | each {|i|
7+
# let branches = open ./scripts/branches.json;
8+
let branches = {
9+
"ssg": ["posix-sh", "ssg"],
10+
"ssg-nushell": ["nushell", "ssg"]
11+
};
12+
let branches_and_paths = $branches | transpose name features | each {|i|
813
print $"# -------------------------------------- #"
914
print $"# --- Testing feature \"($i.name)\" --- #"
1015
print $"# -------------------------------------- #"

wini/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#![allow(incomplete_features, reason = "This is the only way to make it work")]
22
#![feature(specialization)]
3-
#![feature(negative_impls)]
43
#![feature(never_type)]
5-
#![feature(hash_map_macro)]
64
#![feature(impl_trait_in_fn_trait_return)]
75
pub mod components;
86
pub mod cron;

wini/src/pages/hello/mod.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,19 +90,20 @@ async fn test_meta_layer_with_page() {
9090
crate::{shared::wini::layer::MetaLayerBuilder, template},
9191
axum::{middleware::from_fn, routing::get, Router},
9292
axum_test::TestServer,
93+
std::collections::HashMap,
9394
};
9495

9596
let app = Router::new()
9697
.route("/meta", get(test_meta))
9798
.route("/default", get(render))
9899
.layer(
99100
MetaLayerBuilder::default()
100-
.default_meta(hash_map! {
101-
"hello" => "world".into(),
102-
"world" => "hello".into(),
103-
"keywords" => "hello, world".into(),
104-
})
105-
.force_meta(hash_map! {"title" => "hi world!".into()})
101+
.default_meta(HashMap::from_iter([
102+
("hello", "world".into()),
103+
("world", "hello".into()),
104+
("keywords", "hello, world".into()),
105+
]))
106+
.force_meta(HashMap::from_iter([("title", "hi world!".into())]))
106107
.build()
107108
.unwrap(),
108109
)

wini/src/server.rs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ use {
2020
},
2121
axum::{middleware, routing::get, Router},
2222
log::info,
23+
std::collections::HashMap,
2324
tower_http::compression::CompressionLayer,
2425
};
2526

@@ -39,11 +40,11 @@ pub async fn start() {
3940
.layer(middleware::from_fn(header::render))
4041
.layer(
4142
MetaLayerBuilder::default()
42-
.default_meta(hash_map! {
43-
"title" => "PROJECT_NAME_TO_RESOLVE".into(),
44-
"description" => "PROJECT_NAME_TO_RESOLVE".into(),
45-
"lang" => "en".into(),
46-
})
43+
.default_meta(HashMap::from_iter([
44+
("title", "PROJECT_NAME_TO_RESOLVE".into()),
45+
("description", "PROJECT_NAME_TO_RESOLVE".into()),
46+
("lang", "en".into()),
47+
]))
4748
.build()
4849
.expect("Failed to build MetaLayer"),
4950
)
@@ -93,11 +94,11 @@ pub async fn start() {
9394
.layer(middleware::from_fn(header::render))
9495
.layer(
9596
MetaLayerBuilder::default()
96-
.default_meta(hash_map! {
97-
"title" => "PROJECT_NAME_TO_RESOLVE".into(),
98-
"description" => "PROJECT_NAME_TO_RESOLVE".into(),
99-
"lang" => "en".into(),
100-
})
97+
.default_meta(HashMap::from_iter([
98+
("title", "PROJECT_NAME_TO_RESOLVE".into()),
99+
("description", "PROJECT_NAME_TO_RESOLVE".into()),
100+
("lang", "en".into()),
101+
]))
101102
.build()
102103
.expect("Failed to build MetaLayer"),
103104
)

0 commit comments

Comments
 (0)