Skip to content

Commit 68bb7d8

Browse files
committed
template: split main.rs and lib.rs
1 parent 90269c4 commit 68bb7d8

10 files changed

Lines changed: 406 additions & 411 deletions

File tree

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
// FIXME(eddyb) update/review these lints.
2+
//
3+
// BEGIN - Embark standard lints v0.4
4+
// do not change or add/remove here, but one can add exceptions after this section
5+
// for more info see: <https://github.com/EmbarkStudios/rust-ecosystem/issues/59>
6+
//#![deny(unsafe_code)] // impractical in this crate dealing with unsafe `ash`
7+
#![warn(
8+
clippy::all,
9+
clippy::await_holding_lock,
10+
clippy::char_lit_as_u8,
11+
clippy::checked_conversions,
12+
clippy::dbg_macro,
13+
clippy::debug_assert_with_mut_call,
14+
clippy::doc_markdown,
15+
clippy::empty_enum,
16+
clippy::enum_glob_use,
17+
clippy::exit,
18+
clippy::expl_impl_clone_on_copy,
19+
clippy::explicit_deref_methods,
20+
clippy::explicit_into_iter_loop,
21+
clippy::fallible_impl_from,
22+
clippy::filter_map_next,
23+
clippy::float_cmp_const,
24+
clippy::fn_params_excessive_bools,
25+
clippy::if_let_mutex,
26+
clippy::implicit_clone,
27+
clippy::imprecise_flops,
28+
clippy::inefficient_to_string,
29+
clippy::invalid_upcast_comparisons,
30+
clippy::large_types_passed_by_value,
31+
clippy::let_unit_value,
32+
clippy::linkedlist,
33+
clippy::lossy_float_literal,
34+
clippy::macro_use_imports,
35+
clippy::manual_ok_or,
36+
clippy::map_err_ignore,
37+
clippy::map_flatten,
38+
clippy::map_unwrap_or,
39+
clippy::match_same_arms,
40+
clippy::match_wildcard_for_single_variants,
41+
clippy::mem_forget,
42+
clippy::mut_mut,
43+
clippy::mutex_integer,
44+
clippy::needless_borrow,
45+
clippy::needless_continue,
46+
clippy::option_option,
47+
clippy::path_buf_push_overwrite,
48+
clippy::ptr_as_ptr,
49+
clippy::ref_option_ref,
50+
clippy::rest_pat_in_fully_bound_structs,
51+
clippy::same_functions_in_if_condition,
52+
clippy::semicolon_if_nothing_returned,
53+
clippy::string_add_assign,
54+
clippy::string_add,
55+
clippy::string_lit_as_bytes,
56+
clippy::string_to_string,
57+
clippy::todo,
58+
clippy::trait_duplication_in_bounds,
59+
clippy::unimplemented,
60+
clippy::unnested_or_patterns,
61+
clippy::unused_self,
62+
clippy::useless_transmute,
63+
clippy::verbose_file_reads,
64+
clippy::zero_sized_map_values,
65+
future_incompatible,
66+
nonstandard_style,
67+
rust_2018_idioms
68+
)]
69+
// END - Embark standard lints v0.4
70+
// crate-specific exceptions:
71+
// #![allow()]
72+
73+
pub mod ash_renderer;
74+
75+
pub fn enable_debug_layer() -> bool {
76+
std::env::var("DEBUG_LAYER")
77+
.map(|e| !(e == "0" || e == "false"))
78+
.unwrap_or(false)
79+
}
Lines changed: 1 addition & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,3 @@
1-
// FIXME(eddyb) update/review these lints.
2-
//
3-
// BEGIN - Embark standard lints v0.4
4-
// do not change or add/remove here, but one can add exceptions after this section
5-
// for more info see: <https://github.com/EmbarkStudios/rust-ecosystem/issues/59>
6-
//#![deny(unsafe_code)] // impractical in this crate dealing with unsafe `ash`
7-
#![warn(
8-
clippy::all,
9-
clippy::await_holding_lock,
10-
clippy::char_lit_as_u8,
11-
clippy::checked_conversions,
12-
clippy::dbg_macro,
13-
clippy::debug_assert_with_mut_call,
14-
clippy::doc_markdown,
15-
clippy::empty_enum,
16-
clippy::enum_glob_use,
17-
clippy::exit,
18-
clippy::expl_impl_clone_on_copy,
19-
clippy::explicit_deref_methods,
20-
clippy::explicit_into_iter_loop,
21-
clippy::fallible_impl_from,
22-
clippy::filter_map_next,
23-
clippy::float_cmp_const,
24-
clippy::fn_params_excessive_bools,
25-
clippy::if_let_mutex,
26-
clippy::implicit_clone,
27-
clippy::imprecise_flops,
28-
clippy::inefficient_to_string,
29-
clippy::invalid_upcast_comparisons,
30-
clippy::large_types_passed_by_value,
31-
clippy::let_unit_value,
32-
clippy::linkedlist,
33-
clippy::lossy_float_literal,
34-
clippy::macro_use_imports,
35-
clippy::manual_ok_or,
36-
clippy::map_err_ignore,
37-
clippy::map_flatten,
38-
clippy::map_unwrap_or,
39-
clippy::match_same_arms,
40-
clippy::match_wildcard_for_single_variants,
41-
clippy::mem_forget,
42-
clippy::mut_mut,
43-
clippy::mutex_integer,
44-
clippy::needless_borrow,
45-
clippy::needless_continue,
46-
clippy::option_option,
47-
clippy::path_buf_push_overwrite,
48-
clippy::ptr_as_ptr,
49-
clippy::ref_option_ref,
50-
clippy::rest_pat_in_fully_bound_structs,
51-
clippy::same_functions_in_if_condition,
52-
clippy::semicolon_if_nothing_returned,
53-
clippy::string_add_assign,
54-
clippy::string_add,
55-
clippy::string_lit_as_bytes,
56-
clippy::string_to_string,
57-
clippy::todo,
58-
clippy::trait_duplication_in_bounds,
59-
clippy::unimplemented,
60-
clippy::unnested_or_patterns,
61-
clippy::unused_self,
62-
clippy::useless_transmute,
63-
clippy::verbose_file_reads,
64-
clippy::zero_sized_map_values,
65-
future_incompatible,
66-
nonstandard_style,
67-
rust_2018_idioms
68-
)]
69-
// END - Embark standard lints v0.4
70-
// crate-specific exceptions:
71-
// #![allow()]
72-
73-
pub mod ash_renderer;
74-
751
pub fn main() -> anyhow::Result<()> {
76-
ash_renderer::main()
77-
}
78-
79-
pub fn enable_debug_layer() -> bool {
80-
std::env::var("DEBUG_LAYER")
81-
.map(|e| !(e == "0" || e == "false"))
82-
.unwrap_or(false)
2+
mygraphics::ash_renderer::main()
833
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
// FIXME(eddyb) update/review these lints.
2+
//
3+
// BEGIN - Embark standard lints v0.4
4+
// do not change or add/remove here, but one can add exceptions after this section
5+
// for more info see: <https://github.com/EmbarkStudios/rust-ecosystem/issues/59>
6+
//#![deny(unsafe_code)] // impractical in this crate dealing with unsafe `ash`
7+
#![warn(
8+
clippy::all,
9+
clippy::await_holding_lock,
10+
clippy::char_lit_as_u8,
11+
clippy::checked_conversions,
12+
clippy::dbg_macro,
13+
clippy::debug_assert_with_mut_call,
14+
clippy::doc_markdown,
15+
clippy::empty_enum,
16+
clippy::enum_glob_use,
17+
clippy::exit,
18+
clippy::expl_impl_clone_on_copy,
19+
clippy::explicit_deref_methods,
20+
clippy::explicit_into_iter_loop,
21+
clippy::fallible_impl_from,
22+
clippy::filter_map_next,
23+
clippy::float_cmp_const,
24+
clippy::fn_params_excessive_bools,
25+
clippy::if_let_mutex,
26+
clippy::implicit_clone,
27+
clippy::imprecise_flops,
28+
clippy::inefficient_to_string,
29+
clippy::invalid_upcast_comparisons,
30+
clippy::large_types_passed_by_value,
31+
clippy::let_unit_value,
32+
clippy::linkedlist,
33+
clippy::lossy_float_literal,
34+
clippy::macro_use_imports,
35+
clippy::manual_ok_or,
36+
clippy::map_err_ignore,
37+
clippy::map_flatten,
38+
clippy::map_unwrap_or,
39+
clippy::match_same_arms,
40+
clippy::match_wildcard_for_single_variants,
41+
clippy::mem_forget,
42+
clippy::mut_mut,
43+
clippy::mutex_integer,
44+
clippy::needless_borrow,
45+
clippy::needless_continue,
46+
clippy::option_option,
47+
clippy::path_buf_push_overwrite,
48+
clippy::ptr_as_ptr,
49+
clippy::ref_option_ref,
50+
clippy::rest_pat_in_fully_bound_structs,
51+
clippy::same_functions_in_if_condition,
52+
clippy::semicolon_if_nothing_returned,
53+
clippy::string_add_assign,
54+
clippy::string_add,
55+
clippy::string_lit_as_bytes,
56+
clippy::string_to_string,
57+
clippy::todo,
58+
clippy::trait_duplication_in_bounds,
59+
clippy::unimplemented,
60+
clippy::unnested_or_patterns,
61+
clippy::unused_self,
62+
clippy::useless_transmute,
63+
clippy::verbose_file_reads,
64+
clippy::zero_sized_map_values,
65+
future_incompatible,
66+
nonstandard_style,
67+
rust_2018_idioms
68+
)]
69+
// END - Embark standard lints v0.4
70+
// crate-specific exceptions:
71+
// #![allow()]
72+
73+
pub mod ash_renderer;
74+
75+
pub fn enable_debug_layer() -> bool {
76+
std::env::var("DEBUG_LAYER")
77+
.map(|e| !(e == "0" || e == "false"))
78+
.unwrap_or(false)
79+
}
Lines changed: 1 addition & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,3 @@
1-
// FIXME(eddyb) update/review these lints.
2-
//
3-
// BEGIN - Embark standard lints v0.4
4-
// do not change or add/remove here, but one can add exceptions after this section
5-
// for more info see: <https://github.com/EmbarkStudios/rust-ecosystem/issues/59>
6-
//#![deny(unsafe_code)] // impractical in this crate dealing with unsafe `ash`
7-
#![warn(
8-
clippy::all,
9-
clippy::await_holding_lock,
10-
clippy::char_lit_as_u8,
11-
clippy::checked_conversions,
12-
clippy::dbg_macro,
13-
clippy::debug_assert_with_mut_call,
14-
clippy::doc_markdown,
15-
clippy::empty_enum,
16-
clippy::enum_glob_use,
17-
clippy::exit,
18-
clippy::expl_impl_clone_on_copy,
19-
clippy::explicit_deref_methods,
20-
clippy::explicit_into_iter_loop,
21-
clippy::fallible_impl_from,
22-
clippy::filter_map_next,
23-
clippy::float_cmp_const,
24-
clippy::fn_params_excessive_bools,
25-
clippy::if_let_mutex,
26-
clippy::implicit_clone,
27-
clippy::imprecise_flops,
28-
clippy::inefficient_to_string,
29-
clippy::invalid_upcast_comparisons,
30-
clippy::large_types_passed_by_value,
31-
clippy::let_unit_value,
32-
clippy::linkedlist,
33-
clippy::lossy_float_literal,
34-
clippy::macro_use_imports,
35-
clippy::manual_ok_or,
36-
clippy::map_err_ignore,
37-
clippy::map_flatten,
38-
clippy::map_unwrap_or,
39-
clippy::match_same_arms,
40-
clippy::match_wildcard_for_single_variants,
41-
clippy::mem_forget,
42-
clippy::mut_mut,
43-
clippy::mutex_integer,
44-
clippy::needless_borrow,
45-
clippy::needless_continue,
46-
clippy::option_option,
47-
clippy::path_buf_push_overwrite,
48-
clippy::ptr_as_ptr,
49-
clippy::ref_option_ref,
50-
clippy::rest_pat_in_fully_bound_structs,
51-
clippy::same_functions_in_if_condition,
52-
clippy::semicolon_if_nothing_returned,
53-
clippy::string_add_assign,
54-
clippy::string_add,
55-
clippy::string_lit_as_bytes,
56-
clippy::string_to_string,
57-
clippy::todo,
58-
clippy::trait_duplication_in_bounds,
59-
clippy::unimplemented,
60-
clippy::unnested_or_patterns,
61-
clippy::unused_self,
62-
clippy::useless_transmute,
63-
clippy::verbose_file_reads,
64-
clippy::zero_sized_map_values,
65-
future_incompatible,
66-
nonstandard_style,
67-
rust_2018_idioms
68-
)]
69-
// END - Embark standard lints v0.4
70-
// crate-specific exceptions:
71-
// #![allow()]
72-
73-
pub mod ash_renderer;
74-
751
pub fn main() -> anyhow::Result<()> {
76-
ash_renderer::main()
77-
}
78-
79-
pub fn enable_debug_layer() -> bool {
80-
std::env::var("DEBUG_LAYER")
81-
.map(|e| !(e == "0" || e == "false"))
82-
.unwrap_or(false)
2+
mygraphics::ash_renderer::main()
833
}

0 commit comments

Comments
 (0)