MCPcopy Create free account
hub / github.com/hashintel/hash / zip

Method zip

libs/@local/hashql/diagnostics/src/status.rs:927–987  ·  view source on GitHub ↗
(this: Self, other: Status<B, C, S>)

Source from the content-addressed store, hash-verified

925 }
926
927 fn zip<B>(this: Self, other: Status<B, C, S>) -> Self::Zip<T, B> {
928 match (this, other) {
929 (
930 Ok(Success {
931 value: self_value,
932 advisories: mut self_advisories,
933 }),
934 Ok(Success {
935 value: other_value,
936 advisories: mut other_advisories,
937 }),
938 ) => {
939 self_advisories.append(&mut other_advisories);
940 Ok(Success {
941 value: (self_value, other_value),
942 advisories: self_advisories,
943 })
944 }
945 (
946 Err(Failure {
947 primary: self_primary,
948 secondary: mut self_secondary,
949 }),
950 Err(Failure {
951 primary: other_primary,
952 secondary: mut other_secondary,
953 }),
954 ) => {
955 self_secondary.push(other_primary.generalize());
956 self_secondary.append(&mut other_secondary);
957
958 Err(Failure {
959 primary: self_primary,
960 secondary: self_secondary,
961 })
962 }
963 (
964 Ok(Success {
965 value: _,
966 advisories,
967 }),
968 Err(Failure {
969 primary,
970 mut secondary,
971 }),
972 )
973 | (
974 Err(Failure {
975 primary,
976 mut secondary,
977 }),
978 Ok(Success {
979 value: _,
980 advisories,
981 }),
982 ) => {
983 secondary.append(&mut advisories.generalize());
984 Err(Failure { primary, secondary })

Callers 15

seed_dbFunction · 0.80
create_producerMethod · 0.80
anyhow_nostdFunction · 0.80
realmsMethod · 0.80
realms_mutMethod · 0.80
buildMethod · 0.80
assert_diagnosticsFunction · 0.80
joinMethod · 0.80
meetMethod · 0.80
is_subtype_ofMethod · 0.80
is_equivalentMethod · 0.80

Calls 5

OkInterface · 0.85
ErrInterface · 0.85
appendMethod · 0.65
pushMethod · 0.65
generalizeMethod · 0.45

Tested by 6

anyhow_nostdFunction · 0.64
assert_diagnosticsFunction · 0.64
assert_latticeFunction · 0.64
deterministic_resultsFunction · 0.64
assert_assignment_localsFunction · 0.64
read_policiesFunction · 0.64