1. 11 Jan, 2022 1 commit
  2. 09 Jan, 2022 1 commit
  3. 07 Jan, 2022 5 commits
    • Erutuon's avatar
      mwtitle: have Title::new_unchecked and Title::with_fragment take String · e47adce8
      Erutuon authored
      This allows you to avoid allocation if you already have a `String`, for instance when you construct a `Title` from a `PageNamespace` (an `i32` wrapper) and `PageTitle`s (a `String` wrapper) parsed from a SQL dump file by `parse-mediawiki-sql`.
      
      We have also tested using `SmartString`s inside Title, and it doesn't seem to give significant performance benefits, so we will probably stick with `String`s from now on.
      e47adce8
    • Erutuon's avatar
      mwtitle: mark Title::new_unchecked as unsafe · 215ee74a
      Erutuon authored
      It allows you to break assumptions about the `namespace` and `dbkey` fields: that the namespace is found in the `NamespaceMap` or `TitleCodec`, that `dbkey` is normalized so that `Eq` and `Ord` give the expected results.
      
      Removed incomplete normalization of `dbkey` in `Title::new_unchecked`.
      215ee74a
    • Erutuon's avatar
      mwtitle: better Ord and PartialOrd for Title with interwiki · e4de65f6
      Erutuon authored
      Because of the order of fields, the automatically generated Ord implementation would mix titles with interwikis in with titles without. It makes more sense to sort by proximity to the current wiki: titles without interwikis first, then titles with local interwikis, then titles with other interwikis.
      e4de65f6
    • Erutuon's avatar
      mwtitle: make NamespaceMap::display_title and TitleWhitespace public · c09df0da
      Erutuon authored
      This makes `TitleDisplay` available to other crates (as `impl Display + 'title`).
      c09df0da
    • Erutuon's avatar
      mwtitle: namespace_map field of TitleCodec doesn't need to be public · f5636a9a
      Erutuon authored
      This was probably left over from an earlier stage where `NamespaceMap` didn't have useful constructors.
      f5636a9a
  4. 06 Jan, 2022 10 commits
  5. 05 Jan, 2022 2 commits
  6. 04 Jan, 2022 19 commits
  7. 03 Jan, 2022 2 commits
    • legoktm's avatar
      Merge branch 'miri' into 'master' · 208be7da
      legoktm authored
      build: Run miri for mwtitle
      
      See merge request !41
      208be7da
    • legoktm's avatar
      build: Run miri for mwtitle · b38ba549
      legoktm authored
      miri (<https://github.com/rust-lang/miri>) is a tool that checks for certain
      kinds of undefined behavior, especially for unsafe code.
      
      Since mwtitle has some unsafe code, let's try to use miri to audit it.
      
      Unfortunately any test that uses tokio is incompatible with miri because
      it uses an external syscall (epoll). For now these are ignored but we should
      see if we can avoid having to invoke requests for these.
      
      Added to the pipeline in <rust-ci-pipeline!1>.
      b38ba549