Browse Source

Update Rust documentation (1.88.0)

Fixes #2510.
Simon Legner 5 months ago
parent
commit
2a2c11bd10
2 changed files with 5 additions and 3 deletions
  1. 4 2
      lib/docs/filters/rust/entries.rb
  2. 1 1
      lib/docs/scrapers/rust.rb

+ 4 - 2
lib/docs/filters/rust/entries.rb

@@ -4,8 +4,10 @@ module Docs
 
       def get_name
         if slug.start_with?('book') || slug.start_with?('reference')
-          name = at_css("#sidebar a[href='#{File.basename(slug)}']")
-          name ? name.content : 'Introduction'
+          name = at_css("h2", "h1")
+          ch1 = slug[/ch(\d+)-(\d+)/, 1]
+          ch2 = slug[/ch(\d+)-(\d+)/, 2]
+          name ? "#{ch1}.#{ch2}. #{name.content}" : 'Introduction'
         elsif slug == 'error-index'
           'Compiler Errors'
         else

+ 1 - 1
lib/docs/scrapers/rust.rb

@@ -3,7 +3,7 @@
 module Docs
   class Rust < UrlScraper
     self.type = 'rust'
-    self.release = '1.87.0'
+    self.release = '1.88.0'
     self.base_url = 'https://doc.rust-lang.org/'
     self.root_path = 'book/index.html'
     self.initial_paths = %w(