WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 061e2c7

Browse files
committed
Update Rust documentation (1.91.1)
1 parent a102a16 commit 061e2c7

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

lib/docs/filters/rust/entries.rb

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,22 @@ class Rust
33
class EntriesFilter < Docs::EntriesFilter
44

55
def get_name
6-
if slug.start_with?('book')
7-
name = at_css('main h1', 'main h2')
8-
9-
if slug.start_with?('book/appendix')
10-
return name ? name.content : 'Appendix'
11-
end
12-
6+
name = at_css('main h1', 'main h2', '.main-heading h1')
7+
if slug.start_with?('book/appendix')
8+
name ? name.content : 'Appendix'
9+
elsif slug.start_with?('book')
1310
ch1 = slug[/ch(\d+)-(\d+)/, 1] || '00'
1411
ch2 = slug[/ch(\d+)-(\d+)/, 2] || '00'
1512
name ? "#{ch1}.#{ch2}. #{name.content}" : 'Introduction'
1613
elsif slug.start_with?('reference')
17-
at_css('main h1').content
14+
name.content
1815
elsif slug == 'error_codes/error-index'
1916
'Compiler Errors'
2017
elsif slug.start_with?('error_codes')
2118
slug.split('/').last.upcase
2219
else
23-
at_css('main h1').at_css('button')&.remove
24-
name = at_css('main h1').content.remove(/\A.+\s/).remove('⎘')
20+
name.at_css('button')&.remove
21+
name = name.content.strip.remove(/\A.+\s/)
2522
path = slug.split('/')
2623
if path.length == 2
2724
# Anything in the standard library but not in a `std::*` module is

lib/docs/scrapers/rust.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
module Docs
44
class Rust < UrlScraper
55
self.type = 'rust'
6-
self.release = '1.90.0'
6+
self.release = '1.91.1'
77
self.base_url = 'https://doc.rust-lang.org/'
88
self.root_path = 'book/index.html'
99
self.initial_paths = %w(

0 commit comments

Comments
 (0)