FILENAME 4/4 - naming_sqlite.rs uses NameType not NameKind
commit66981dcca6221a5bf9c5d4aeb4440bcc6f3bb844
authorLucian Wischik <ljw@fb.com>
Wed, 6 Oct 2021 17:53:21 +0000 (6 10:53 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 6 Oct 2021 17:55:56 +0000 (6 10:55 -0700)
treeb0b79ba0db93ee4bccda091d7f2dff15ea5d9be9
parent93fb915140599ee8a777ad198050bba22d961341
FILENAME 4/4 - naming_sqlite.rs uses NameType not NameKind

Summary:
My goal is to have a clean implementation of the FILENAME action all the way from Naming_provider through to decl-service-worker.

There are two types in ocaml, `Naming_types.name_kind` which has structure and `FileInfo.name_type` which doesn't. The ocaml codebase uses both, mostly through historical legacy of code which (pointlessly) uses `Naming_types.kind_of_type`.

The decl service doesn't need that legacy. I've switched over to using `file_info::NameType` everywhere in the decl service. Indeed, the only consumer of it was Naming_provider.ml, which always wanted a NameType, so all the intermediate uses of NameKind were just a waste.

I also moved `impl FromSql for SqliteNameKind` in naming_sqlite/datatypes.rs into `impl FromSql for NameType` in oxidized/file_info_impl.rs. It feels a little bit awkward that a really tiny atomic type like file_info should depend upon rusqlite, but only a little bit.

Differential Revision: D31326773

fbshipit-source-id: 1acd6394f10dd11a4e19179be2a0373cac8ece8a
hphp/hack/Cargo.lock
hphp/hack/src/oxidized/Cargo.toml
hphp/hack/src/oxidized/manual/file_info_impl.rs
hphp/hack/src/oxidized/manual/mod.rs
hphp/hack/src/oxidized/manual/naming_types_impl.rs [deleted file]