Robbepop / string-interner

A data structure to efficiently intern, cache and restore strings.
Other
175 stars 30 forks source link

`Clone`d can no longer find interned symbols #33

Closed alamb closed 3 years ago

alamb commented 3 years ago

Reproducer:

            let mut interner = StringInterner::new();
            assert_eq!(interner.get_or_intern("a").to_usize(), 0);

            let mut cloned = interner.clone();
            assert_eq!(cloned.get_or_intern("a").to_usize(), 0);

This currently fails on as the cloned interner returns 1 instead of zero (as it can't find the previously interned value "a".

BTW we ran into this when we were using the string interner in InfluxDB IOx https://github.com/influxdata/influxdb_iox/pull/630

Robbepop commented 3 years ago

Thank you for the issue and the PR! New release: https://github.com/Robbepop/string-interner/releases/tag/v0.12.2 Also already published to crates.io.

alamb commented 3 years ago

Thanks @Robbepop -- I upgraded in https://github.com/influxdata/influxdb_iox/pull/641 and now thing work like a charm. 👍

Robbepop commented 3 years ago

Thanks @Robbepop -- I upgraded in influxdata/influxdb_iox#641 and now thing work like a charm. +1

Glad to hear that!