Skip to content

Commit

Permalink
fix dep cycle for Rust
Browse files Browse the repository at this point in the history
  • Loading branch information
inferrinizzard committed May 5, 2024
1 parent 0f97dc6 commit e8b3dfb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
4 changes: 3 additions & 1 deletion packages/quicktype-core/src/language/Rust/RustRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ import { type ClassType, type EnumType, type Type, UnionType } from "../../Type"
import { matchType, nullableFromUnion, removeNullFromUnion } from "../../TypeUtils";

import { keywords } from "./constants";
import { Density, Visibility, type rustOptions } from "./language";
import { type rustOptions } from "./language";
import {
Density,
Visibility,
camelNamingFunction,
getPreferedNamingStyle,
listMatchingNamingStyles,
Expand Down
12 changes: 1 addition & 11 deletions packages/quicktype-core/src/language/Rust/language.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,7 @@ import { TargetLanguage } from "../../TargetLanguage";
import { type FixMeOptionsAnyType, type FixMeOptionsType } from "../../types";

import { RustRenderer } from "./RustRenderer";

export enum Density {
Normal = "Normal",
Dense = "Dense"
}

export enum Visibility {
Private = "Private",
Crate = "Crate",
Public = "Public"
}
import { Density, Visibility } from "./utils";

export const rustOptions = {
density: new EnumOption("density", "Density", [
Expand Down
11 changes: 11 additions & 0 deletions packages/quicktype-core/src/language/Rust/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ import {
utf32ConcatMap
} from "../../support/Strings";

export enum Density {
Normal = "Normal",
Dense = "Dense"
}

export enum Visibility {
Private = "Private",
Crate = "Crate",
Public = "Public"
}

type NameToParts = (name: string) => string[];
type PartsToName = (parts: string[]) => string;
interface NamingStyle {
Expand Down

0 comments on commit e8b3dfb

Please sign in to comment.