load("@crate_index//:defs.bzl", "aliases", "all_crate_deps") load("@rules_rust//rust:defs.bzl", "rust_library") rust_library( name = "mycalculator", srcs = glob([ "src/**/*.rs", ]), aliases = aliases(), deps = all_crate_deps(), proc_macro_deps = all_crate_deps( proc_macro = True, ), visibility = ["//visibility:public"], ) # Declares a Rust test target with the given name. load("@rules_rust//rust:defs.bzl", "rust_test") rust_test( name = "mycalculator_test", # Specifies the source file for the test. srcs = ["src/lib.rs"], # Specifies dependencies for the test. deps = [ # Depend on the library we just declared. ":mycalculator", ], # Specifies the Rust edition to use for this test. edition = "2021" )