c521753057
* Add crate snafu * Replace all inline structs in AnkiError * Derive Snafu on AnkiError * Use snafu for card type errors * Use snafu whatever error for InvalidInput * Use snafu for NotFoundError and improve message * Use snafu for FileIoError to attach context Remove IoError. Add some context-attaching helpers to replace code returning bare io::Errors. * Add more context-attaching io helpers * Add message, context and backtrace to new snafus * Utilize error context and backtrace on frontend * Rename LocalizedError -> BackendError. * Remove DocumentedError. * Have all backend exceptions inherit BackendError. * Rename localized(_description) -> message * Remove accidentally committed experimental trait * invalid_input_context -> ok_or_invalid * ensure_valid_input! -> require! * Always return `Err` from `invalid_input!` Instead of a Result to unwrap, the macro accepts a source error now. * new_tempfile_in_parent -> new_tempfile_in_parent_of * ok_or_not_found -> or_not_found * ok_or_invalid -> or_invalid * Add crate convert_case * Use unqualified lowercase type name * Remove uses of snafu::ensure * Allow public construction of InvalidInputErrors (dae) Needed to port the AnkiDroid changes. * Make into_protobuf() public (dae) Also required for AnkiDroid. Not sure why it worked previously - possible bug in older Rust version?
135 lines
3.5 KiB
Plaintext
Vendored
135 lines
3.5 KiB
Plaintext
Vendored
"""
|
|
@generated
|
|
cargo-raze crate build file.
|
|
|
|
DO NOT EDIT! Replaced on runs of cargo-raze
|
|
"""
|
|
|
|
# buildifier: disable=load
|
|
load("@bazel_skylib//lib:selects.bzl", "selects")
|
|
|
|
# buildifier: disable=load
|
|
load(
|
|
"@rules_rust//rust:defs.bzl",
|
|
"rust_binary",
|
|
"rust_library",
|
|
"rust_proc_macro",
|
|
"rust_test",
|
|
)
|
|
|
|
package(default_visibility = [
|
|
# Public for visibility by "@raze__crate__version//" targets.
|
|
#
|
|
# Prefer access through "//cargo", which limits external
|
|
# visibility to explicit Cargo.toml dependencies.
|
|
"//visibility:public",
|
|
])
|
|
|
|
licenses([
|
|
"notice", # MIT from expression "MIT OR Apache-2.0"
|
|
])
|
|
|
|
# Generated Targets
|
|
|
|
rust_library(
|
|
name = "snafu",
|
|
srcs = glob(["**/*.rs"]),
|
|
crate_features = [
|
|
"backtrace",
|
|
"backtraces",
|
|
"default",
|
|
"rust_1_39",
|
|
"rust_1_46",
|
|
"std",
|
|
],
|
|
crate_root = "src/lib.rs",
|
|
data = [],
|
|
compile_data = glob(["**/*.md"]),
|
|
edition = "2018",
|
|
proc_macro_deps = [
|
|
"@raze__snafu_derive__0_7_2//:snafu_derive",
|
|
],
|
|
rustc_flags = [
|
|
"--cap-lints=allow",
|
|
],
|
|
tags = [
|
|
"cargo-raze",
|
|
"crate-name=snafu",
|
|
"manual",
|
|
],
|
|
version = "0.7.2",
|
|
# buildifier: leave-alone
|
|
deps = [
|
|
"@raze__backtrace__0_3_66//:backtrace",
|
|
"@raze__doc_comment__0_3_3//:doc_comment",
|
|
],
|
|
)
|
|
|
|
# Unsupported target "backtrace" with type "test" omitted
|
|
|
|
# Unsupported target "backtrace-optional" with type "test" omitted
|
|
|
|
# Unsupported target "backtrace-optional-enabled" with type "test" omitted
|
|
|
|
# Unsupported target "backtrace_attributes" with type "test" omitted
|
|
|
|
# Unsupported target "basic" with type "test" omitted
|
|
|
|
# Unsupported target "boxed_error_trait_object" with type "test" omitted
|
|
|
|
# Unsupported target "build-leaf-error" with type "test" omitted
|
|
|
|
# Unsupported target "context_selector_name" with type "test" omitted
|
|
|
|
# Unsupported target "default_error_display" with type "test" omitted
|
|
|
|
# Unsupported target "display-shorthand" with type "test" omitted
|
|
|
|
# Unsupported target "doc_comment" with type "test" omitted
|
|
|
|
# Unsupported target "ensure" with type "test" omitted
|
|
|
|
# Unsupported target "error_chain" with type "test" omitted
|
|
|
|
# Unsupported target "generics" with type "test" omitted
|
|
|
|
# Unsupported target "generics_with_default" with type "test" omitted
|
|
|
|
# Unsupported target "implicit" with type "test" omitted
|
|
|
|
# Unsupported target "location" with type "test" omitted
|
|
|
|
# Unsupported target "mapping_result_without_try_operator" with type "test" omitted
|
|
|
|
# Unsupported target "module" with type "test" omitted
|
|
|
|
# Unsupported target "multiple_attributes" with type "test" omitted
|
|
|
|
# Unsupported target "name-conflicts" with type "test" omitted
|
|
|
|
# Unsupported target "no_context" with type "test" omitted
|
|
|
|
# Unsupported target "opaque" with type "test" omitted
|
|
|
|
# Unsupported target "options" with type "test" omitted
|
|
|
|
# Unsupported target "premade_error" with type "test" omitted
|
|
|
|
# Unsupported target "raw_idents" with type "test" omitted
|
|
|
|
# Unsupported target "recursive_error" with type "test" omitted
|
|
|
|
# Unsupported target "report" with type "test" omitted
|
|
|
|
# Unsupported target "send_between_threads" with type "test" omitted
|
|
|
|
# Unsupported target "single_use_lifetimes_lint" with type "test" omitted
|
|
|
|
# Unsupported target "source_attributes" with type "test" omitted
|
|
|
|
# Unsupported target "stringly_typed" with type "test" omitted
|
|
|
|
# Unsupported target "structs" with type "test" omitted
|
|
|
|
# Unsupported target "visibility" with type "test" omitted
|