Skip to content

Commit

Permalink
Remove forgotten conditionals
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmarkov committed Nov 9, 2024
1 parent 76cd380 commit 3a84402
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
8 changes: 0 additions & 8 deletions cargo/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
{% unless std -%}
#![no_std]
#![no_main]

{% endunless -%}
{% unless std -%}
#[no_mangle]
{% endunless -%}
fn main() {
// It is necessary to call this function once. Otherwise some patches to the runtime
// implemented by esp-idf-sys might not link properly. See https://github.com/esp-rs/esp-idf-template/issues/71
Expand Down
17 changes: 1 addition & 16 deletions cmake/components/rust-{{project-name}}/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{% unless std -%}
#![no_std]
{% endunless -%}

#[no_mangle]
extern "C" fn rust_main() -> i32 {
{%- if hal %}
// It is necessary to call this function once. Otherwise some patches to the runtime
// implemented by esp-idf-sys might not link properly. See https://github.com/esp-rs/esp-idf-template/issues/71
esp_idf_svc::sys::link_patches();
Expand All @@ -13,16 +8,6 @@ extern "C" fn rust_main() -> i32 {
esp_idf_svc::log::EspLogger::initialize_default();

log::info!("Hello, world!");
{%- elsif std %}
println!("Hello, world from Rust!");
{%- endif %}
42
}

{% unless hal -%}
#[panic_handler]
fn panic(_info: &core::panic::PanicInfo) -> ! {
loop {
}
42
}
{% endunless -%}

0 comments on commit 3a84402

Please sign in to comment.