Skip to content

Commit 3659c88

Browse files
Celso Bonutti FilhoCelso Bonutti Filho
Celso Bonutti Filho
authored and
Celso Bonutti Filho
committed
first commit
0 parents  commit 3659c88

File tree

4 files changed

+45
-0
lines changed

4 files changed

+45
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/target

Cargo.lock

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[package]
2+
name = "rescript-react-feather"
3+
version = "0.1.0"
4+
edition = "2018"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+
[dependencies]

src/main.rs

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
use std::fmt::Display;
2+
3+
fn main() {
4+
println!("Hello, world!");
5+
}
6+
7+
struct Icon(String);
8+
9+
impl Icon {
10+
pub fn print(&self) -> String {
11+
let Icon(name) = self;
12+
format!(
13+
"
14+
module {0} = {{
15+
@module(\"react-feather\")
16+
@react.component
17+
external make: props = \"{0}\"
18+
}}",
19+
name
20+
)
21+
}
22+
23+
pub fn print_pattern(icons: Vec<Icon>) -> String {
24+
let beginning = "
25+
@react.component
26+
let make = (~name, ~color, ~size) => {{
27+
switch name {{\n";
28+
}
29+
}

0 commit comments

Comments
 (0)