forked from auracaster/bumble_mirror
Faster company id table
Following up on the [loose end from the initial PR](https://github.com/google/bumble/pull/207#discussion_r1278015116), we can avoid accessing the Python company id map at runtime by doing code gen ahead of time. Using an example to do the code gen avoids even the small build slowdown from invoking the code gen logic in build.rs, but more importantly, means that it's still a totally boring normal build that won't require any IDE setup, etc, to work for everyone. Since the company ID list changes rarely, and there's a test to ensure it always matches, this seems like a good trade.
This commit is contained in:
@@ -12,9 +12,9 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
use bumble::{wrapper, wrapper::transport::Transport};
|
||||
use bumble::wrapper::transport::Transport;
|
||||
use nix::sys::stat::Mode;
|
||||
use pyo3::prelude::*;
|
||||
use pyo3::PyResult;
|
||||
|
||||
#[pyo3_asyncio::tokio::test]
|
||||
async fn fifo_transport_can_open() -> PyResult<()> {
|
||||
@@ -29,9 +29,3 @@ async fn fifo_transport_can_open() -> PyResult<()> {
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[pyo3_asyncio::tokio::test]
|
||||
async fn company_ids() -> PyResult<()> {
|
||||
assert!(wrapper::assigned_numbers::COMPANY_IDS.len() > 2000);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user