Skip to content

Commit da165e3

Browse files
committed
Release 0.1.7: remove last unwraps from codebase.
1 parent e269cf5 commit da165e3

File tree

5 files changed

+17
-8
lines changed

5 files changed

+17
-8
lines changed

Diff for: Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rust-purs-gql"
3-
version = "0.1.6"
3+
version = "0.1.7"
44
edition = "2021"
55
default-run = "pursgql"
66
repository = "https://github.com/OxfordAbstracts/purescript-graphql-schema-gen"

Diff for: src/config/parse_outside_types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ fn to_type_value(type_value: &String, types_fn: &impl Fn(&str, &str) -> Option<M
179179
.last()
180180
.expect(&format!("No type value found after '=' for: {type_value}.")),
181181
)
182-
.unwrap_or_else(|| panic!("Type not found: {}", type_value))
182+
.expect(&format!("Type not found: {}", type_value))
183183
} else if type_value.contains(", ") {
184184
let mut values = type_value.split(", ");
185185
let name = values

Diff for: src/hasura_types.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,14 @@ fn outside_type(
4646
new_object = object;
4747
}
4848
Some(suffix) => {
49-
new_object = object.strip_suffix(suffix).unwrap();
49+
new_object = object
50+
.strip_suffix(suffix)
51+
.expect("Failed to strip suffix that was found.");
5052
for prefix in MODULE_PREFIXES.iter() {
5153
if new_object.starts_with(prefix) {
52-
new_object = new_object.strip_prefix(prefix).unwrap(); // TODO This needs to happen separately. Still needs to be run even without a suffix
54+
new_object = new_object
55+
.strip_prefix(prefix)
56+
.expect("Failed to strip prefix that was found."); // TODO This needs to happen separately. Still needs to be run even without a suffix
5357
}
5458
}
5559
}

Diff for: src/main_check_needs_migrations.rs

+8-3
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,15 @@ async fn main() -> Result<()> {
3939
let migrations: Value = serde_json::from_str(&standard_result.migrations).expect(
4040
"Failed to parse hasura migrations json. Perhaps your Hasura version is mismatched.",
4141
);
42-
let test_migrations: Value = serde_json::from_str(&test_result.migrations).unwrap();
42+
let test_migrations: Value = serde_json::from_str(&test_result.migrations)
43+
.expect("Failed to parse test migrations json.");
4344

44-
let migrations_obj = migrations.as_object().unwrap();
45-
let test_migrations_obj = test_migrations.as_object().unwrap();
45+
let migrations_obj = migrations
46+
.as_object()
47+
.expect("Failed to parse hasura migrations as an object.");
48+
let test_migrations_obj = test_migrations
49+
.as_object()
50+
.expect("Failed to parse test migrations as an object.");
4651

4752
for (k, _) in test_migrations_obj.iter() {
4853
if !migrations_obj.contains_key(k) {

0 commit comments

Comments
 (0)