Skip to content

Commit

Permalink
Merge pull request #346 from palantir/no-panics
Browse files Browse the repository at this point in the history
Remove fallible builders
  • Loading branch information
sfackler authored Apr 21, 2024
2 parents e5d6df3 + ff47372 commit 0e905ef
Show file tree
Hide file tree
Showing 106 changed files with 4,187 additions and 3,046 deletions.
5 changes: 5 additions & 0 deletions changelog/@unreleased/pr-346.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: break
break:
description: Removed support for fallible builders.
links:
- https://github.com/palantir/conjure-rust/pull/346
7 changes: 0 additions & 7 deletions conjure-codegen/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ struct TypeContext {
pub struct Context {
types: HashMap<TypeName, TypeContext>,
exhaustive: bool,
staged_builders: bool,
strip_prefix: Vec<String>,
version: Option<String>,
}
Expand All @@ -49,14 +48,12 @@ impl Context {
pub fn new(
defs: &ConjureDefinition,
exhaustive: bool,
staged_builders: bool,
strip_prefix: Option<&str>,
version: Option<&str>,
) -> Context {
let mut context = Context {
types: HashMap::new(),
exhaustive,
staged_builders,
strip_prefix: vec![],
version: version.map(str::to_owned),
};
Expand Down Expand Up @@ -103,10 +100,6 @@ impl Context {
self.exhaustive
}

pub fn staged_builders(&self) -> bool {
self.staged_builders
}

fn needs_box(&self, def: &Type) -> bool {
match def {
Type::Primitive(_) => false,
Expand Down
32 changes: 17 additions & 15 deletions conjure-codegen/src/example_types/another/different_package.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

130 changes: 70 additions & 60 deletions conjure-codegen/src/example_types/product/alias_as_map_key_example.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0e905ef

Please sign in to comment.