commit_hash
stringlengths
40
40
author
stringlengths
1
57
date
timestamp[s]date
2010-07-26 04:45:09
2026-04-14 18:21:10
message
stringlengths
8
1.39M
diff
stringlengths
68
51.2k
files_changed
int64
1
136
insertions
int64
0
2.35k
deletions
int64
0
1.9k
e891ea423ee7e1425dd4866e0d6e0fd74554a9e6
Max Heller
2023-11-23T20:05:08
failing test for link titles with interior punctuation
diff --git a/tests/fmt.rs b/tests/fmt.rs index 0b900fe..3332303 100644 --- a/tests/fmt.rs +++ b/tests/fmt.rs @@ -872,6 +872,32 @@ mod escapes { ); } + #[test] + fn link_titles() { + // See https://spec.commonmark.org/0.30/#link-title for the rules around + // link titles and the char...
1
26
0
4768ad54fee48046974dc7b76d3768b62161e959
Max Heller
2023-11-19T16:00:53
multiline footnote fix
diff --git a/src/lib.rs b/src/lib.rs index f305801..84895c8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -327,7 +327,10 @@ where Image(..) => formatter.write_str("!["), Emphasis => formatter.write_char(options.emphasis_token), Strong => formatter.write_str(o...
1
8
2
e18731327065297e4d2ac9d8e24bb6b6db5bbaf0
Max Heller
2023-11-19T15:50:50
failing multiline footnote test
diff --git a/tests/fmt.rs b/tests/fmt.rs index c4f0dfe..0b900fe 100644 --- a/tests/fmt.rs +++ b/tests/fmt.rs @@ -192,9 +192,9 @@ mod inline_elements { #[test] fn footnote() { assert_eq!( - fmts("a [^b]\n[^b]: c"), + fmts("a [^b]\n\n[^b]: c"), ( - "a [...
1
11
2
d9eb45477fc23da0960cdb24f9f20d67bfac0784
Sebastian Thiel
2023-08-18T18:53:34
feat: add apache-2 license text to crate as well
diff --git a/Cargo.toml b/Cargo.toml index cac77e0..cfc822c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ homepage = "https://github.com/Byron/pulldown-cmark-to-cmark" documentation = "https://docs.rs/crate/pulldown-cmark-to-cmark" readme = "README.md" edition = "2018" -include = ["src/lib.rs", "README....
1
1
1
1cd68a41be3079b55179507ca3ececa385b59698
Sebastian Thiel
2023-06-04T06:11:48
refactor - avoid two allocations at the expense of adding complexity - add test to assure backtick-counting works as it should
diff --git a/src/lib.rs b/src/lib.rs index 13ce3e2..f305801 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -225,24 +225,6 @@ where } } - fn count_consecutive_backticks(text: &str) -> usize { - let mut in_backticks = false; - let mut max_backticks = 0; - let mut cur_backticks = 0; - ...
1
43
21
8f81a30c659f21a14d814a6a4505699ac4eda757
Sebastian Thiel
2023-06-04T06:10:39
thanks clippy
diff --git a/src/lib.rs b/src/lib.rs index 600af21..13ce3e2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -157,7 +157,7 @@ where F: fmt::Write, { let mut state = state.unwrap_or_default(); - fn padding<'a, F>(f: &mut F, p: &[Cow<'a, str>]) -> fmt::Result + fn padding<F>(f: &mut F, p: &[Cow<'_, str>]) -> ...
1
2
2
343773455fb08f20817f6de74b0bf8f067a90ba1
Martin Geisler
2023-06-03T15:39:24
Use necessary amount of backticks for inline code We now insert the necessary number of backticks to quote any backticks found in the code span itself. Before, only the case with a single backtick was handled, now the code can contain arbitrarily many backticks. This was found using a fuzz test which tries to fuzz a ...
diff --git a/src/lib.rs b/src/lib.rs index 345fed8..600af21 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -225,6 +225,24 @@ where } } + fn count_consecutive_backticks(text: &str) -> usize { + let mut in_backticks = false; + let mut max_backticks = 0; + let mut cur_backticks = 0; + ...
2
90
6
1e76c955ebd59190a3198ff5a62cd840023486d1
Martin Geisler
2023-06-03T15:11:24
Always use backticks for inline code blocks Before, `options.code_block_token` was used for inline code spans. Now we always use a backtick. As far as I can tell from the reference[1] and from experimentation[2], code spans should always use one or more backticks and never use something else such as tildes. [1]: htt...
diff --git a/src/lib.rs b/src/lib.rs index 3090365..345fed8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,7 +4,6 @@ use std::{ borrow::{Borrow, Cow}, collections::HashSet, fmt, - iter::FromIterator, }; use pulldown_cmark::{Alignment as TableAlignment, Event, HeadingLevel, LinkType}; @@ -265,20 +2...
2
3
14
6bde37483b7578ef554952775e9e0c3332ecf4aa
Sebastian Thiel
2022-12-29T06:52:07
thanks clippy
diff --git a/src/lib.rs b/src/lib.rs index a0994f5..7e9dcc8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -299,7 +299,7 @@ where state.padding.push(padding_of(*inner)); match inner { Some(n) => { - ...
1
1
1
ce1fb72ab7d9db2647e142916e8af0bccc0ec97e
Noritada Kobayashi
2022-12-28T11:01:22
Correct indentation for a nested list in a doc comment
diff --git a/src/lib.rs b/src/lib.rs index 223dc90..193bf7d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -130,14 +130,14 @@ impl<'a> Options<'a> { /// Serialize a stream of [pulldown-cmark-Events][Event] into a string-backed buffer. /// /// 1. **events** -/// * An iterator over [`Events`][Event], for example as ret...
1
5
5
f2fae4b5c64d44d624cb2dff16a70b31306e60ce
Yacin Tmimi
2022-12-28T22:26:39
Add option to increment ordered list number Previously we'd always output the same number for each bullet, based on the first bullet in the list. Take the following list as an example. ```markdown 1. one 2. two 3. three ``` Previously the list would always be output as: ```markdown 1. one 1. two 1. three ``` Now w...
diff --git a/src/lib.rs b/src/lib.rs index 2db64ed..a0994f5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -81,6 +81,7 @@ pub struct Options<'a> { pub code_block_token: char, pub list_token: char, pub ordered_list_token: char, + pub increment_ordered_list_bullets: bool, pub emphasis_token: char, ...
2
115
2
981c86adc847eb8df0c1616b0e7377536f7f59e2
Yacin Tmimi
2022-12-28T22:03:03
Allow users to specify a custom ordered list marker Based on the [commonmark list spec] an ordered list can use `.` or `)` as the ordered list marker. Now users can configure the marker they want to use. [commonmark list spec]: https://spec.commonmark.org/0.30/#lists
diff --git a/src/lib.rs b/src/lib.rs index 223dc90..2db64ed 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -80,6 +80,7 @@ pub struct Options<'a> { pub code_block_token_count: usize, pub code_block_token: char, pub list_token: char, + pub ordered_list_token: char, pub emphasis_token: char, pub s...
2
21
1
89b557a46786f2efebccec010f8c115ad21910e3
Sebastian Thiel
2022-09-10T12:28:08
cargo fmt
diff --git a/examples/stupicat.rs b/examples/stupicat.rs index 5b360a8..df31535 100644 --- a/examples/stupicat.rs +++ b/examples/stupicat.rs @@ -9,7 +9,8 @@ use pulldown_cmark::{Options, Parser}; use pulldown_cmark_to_cmark::{cmark, cmark_resume}; fn main() -> Result<(), Box<dyn std::error::Error>> { - let path ...
1
2
1
ef4c4014b4bc2d6e26240a99a9afd49e60b320f3
gifnksm
2022-09-10T03:25:22
Inserts a newline if there is no newline before code block termination fence fixes: #48
diff --git a/src/lib.rs b/src/lib.rs index d0fb3e1..223dc90 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -52,6 +52,8 @@ pub struct State<'a> { pub is_in_code_block: bool, /// True if the last event was html. Used to inject additional newlines to support markdown inside of HTML tags. pub last_was_html: boo...
2
14
0
32d94668ec4c294f5161ccc8cdba94ada78713d4
gifnksm
2022-09-08T08:36:46
De-duplicate shortcut link definitions fixes #46
diff --git a/src/lib.rs b/src/lib.rs index e770c73..d0fb3e1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,6 +2,7 @@ use std::{ borrow::{Borrow, Cow}, + collections::HashSet, fmt, iter::FromIterator, }; @@ -584,9 +585,14 @@ impl<'a> State<'a> { } formatter.write_str("\n")?; + ...
1
7
1
6f683310f2e6965c6d1d3ee09c3b36eefff5c1a3
Will Crichton
2022-06-24T18:07:34
Add space aroudn backticks
diff --git a/src/lib.rs b/src/lib.rs index 6007f54..e770c73 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -259,15 +259,21 @@ where let code = format!("{}{}{}", options.code_block_token, text, options.code_block_token); text_for_header.push_str(&code); } - ...
2
13
7
09a35a96002cb2ca00e0769c0ae4cc8927698ccd
Will Crichton
2022-06-24T17:59:29
Fix double-backtick issue
diff --git a/src/lib.rs b/src/lib.rs index 739835d..6007f54 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,6 +3,7 @@ use std::{ borrow::{Borrow, Cow}, fmt, + iter::FromIterator, }; use pulldown_cmark::{Alignment as TableAlignment, Event, HeadingLevel, LinkType}; @@ -258,10 +259,15 @@ where ...
2
27
3
118df1747be21cd4b323bf76d22c6736117af0f9
Scott Kevill
2022-03-10T09:56:06
Fix misc Clippy lints
diff --git a/examples/stupicat.rs b/examples/stupicat.rs index 4c02915..5b360a8 100644 --- a/examples/stupicat.rs +++ b/examples/stupicat.rs @@ -9,9 +9,7 @@ use pulldown_cmark::{Options, Parser}; use pulldown_cmark_to_cmark::{cmark, cmark_resume}; fn main() -> Result<(), Box<dyn std::error::Error>> { - let path ...
3
27
21
16f06eb10bfc084c7e79e6d6e76703452517ae0f
Scott Kevill
2022-03-10T09:48:12
Re-order to logically group cmark* functions
diff --git a/src/lib.rs b/src/lib.rs index 404daaa..739835d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -524,6 +524,20 @@ where Ok(state) } +/// As [`cmark_resume_with_options()`], but with default [`Options`]. +pub fn cmark_resume<'a, I, E, F>( + events: I, + formatter: F, + state: Option<State<'stati...
1
14
14
53efeb83c158978331303d6889a24f6192e40dea
Scott Kevill
2022-03-10T09:45:22
Add cmark_with_options() and fix comments
diff --git a/src/lib.rs b/src/lib.rs index 5b8575c..404daaa 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -28,7 +28,7 @@ impl<'a> From<&'a TableAlignment> for Alignment { } } -/// The state of the [`cmark()`] function. +/// The state of the [`cmark_resume()`] and [`cmark_resume_with_options()`] functions. /// Th...
1
14
4
93f2d11e467221418748c672a3c493dcfbf9d6e7
Sebastian Thiel
2021-12-31T01:29:04
refactor!: Simplify `State` Use an `Option` to get rid ofa boolean and make isuse impossible.
diff --git a/src/lib.rs b/src/lib.rs index 5097890..a53e6cd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -44,8 +44,6 @@ pub struct State<'a> { pub table_alignments: Vec<Alignment>, /// Keeps the current table headers, if we are currently serializing a table. pub table_headers: Vec<String>, - /// If set...
1
12
13
c0f14c058f3639e37ef9cd7971d9fb3965320fe7
Sebastian Thiel
2021-12-31T01:11:35
refactor
diff --git a/src/lib.rs b/src/lib.rs index cb0ec98..5097890 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -54,9 +54,7 @@ pub struct State<'a> { pub last_was_html: bool, /// Keeps track of the last seen shortcut/link - pub current_shortcut_text: String, - /// true if we are within a shortcut - pub ins...
1
8
13
9283d487546bdcef57b602a782c777462d7caa19
Sebastian Thiel
2021-12-31T01:09:10
refactor
diff --git a/src/lib.rs b/src/lib.rs index a32934f..cb0ec98 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -54,7 +54,7 @@ pub struct State<'a> { pub last_was_html: bool, /// Keeps track of the last seen shortcut/link - pub current_shortcut: String, + pub current_shortcut_text: String, /// true if we...
1
7
6
c696de36d0d4a1dc6cfd0c86704844366009697a
Sebastian Thiel
2021-12-26T01:39:24
cargo fmt
diff --git a/src/lib.rs b/src/lib.rs index ce5638f..47a33fe 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,7 +5,7 @@ use std::{ fmt, }; -use pulldown_cmark::{Alignment as TableAlignment, Event, LinkType, HeadingLevel}; +use pulldown_cmark::{Alignment as TableAlignment, Event, HeadingLevel, LinkType}; /// Sim...
2
3
3
2d5d4e1e78c36a8188a79cc5aac944d4ee2f291b
Sebastian Thiel
2021-11-25T00:05:36
use match as expression
diff --git a/src/lib.rs b/src/lib.rs index c4113e3..5e803a0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -222,12 +222,10 @@ where where F: fmt::Write, { - let separator; - - match link_type { - LinkType::Shortcut => separator = ": ", - _ => separator = "(", - ...
1
4
6
06fe6cb1e35e8aca0cd8a4bfe9daacbdd2771698
Sebastian Thiel
2021-11-17T23:32:38
refactor - turn into chars what's never multiple characters.
diff --git a/src/lib.rs b/src/lib.rs index 14cae11..08522e4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,5 @@ +#![deny(rust_2018_idioms)] + use std::{ borrow::{Borrow, Cow}, fmt, @@ -69,13 +71,13 @@ pub struct Options<'a> { pub newlines_after_blockquote: usize, pub newlines_after_rest: usize...
2
34
26
fa147502384bf82fe192719d0c8cc81ba125cc7f
Sebastian Thiel
2021-11-17T23:25:42
More efficient handling of reconfigured characters
diff --git a/src/lib.rs b/src/lib.rs index 23c78c2..14cae11 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -68,41 +68,53 @@ pub struct Options<'a> { pub newlines_after_list: usize, pub newlines_after_blockquote: usize, pub newlines_after_rest: usize, - pub code_block_token_number: usize, + pub code_bl...
1
38
26
9aef43ff21d41bc66df6096d392d0e8a035d11fc
Sebastian Thiel
2021-11-17T23:15:08
cleanup typing for special characters
diff --git a/src/lib.rs b/src/lib.rs index 44eaaf0..23c78c2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -96,14 +96,13 @@ impl<'a> Default for Options<'a> { } impl<'a> Options<'a> { - pub fn special_characters(&self) -> Vec<u8> { - let mut special_chacacters = vec!['#', '\\', '_', '<', '>', '|', '[', ']'];...
2
11
16
db6e12c57753cfeccb010ecdb3104e3d0bc48b41
illumination-k
2021-11-17T16:24:46
change options to support custom syntax and add test
diff --git a/src/lib.rs b/src/lib.rs index 1d431ab..44eaaf0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,8 +5,6 @@ use std::{ use pulldown_cmark::{Alignment as TableAlignment, Event}; -pub const SPECIAL_CHARACTERS: &[u8] = br#"#\_*<>`|[]"#; - /// Similar to [Pulldown-Cmark-Alignment][Alignment], but with requir...
2
116
29
72e5ca549d0acb9bd59f1d8b1c1c8f55eac604ef
Sebastian Thiel
2021-09-25T02:38:12
Release pulldown-cmark-to-cmark v6.0.4
diff --git a/Cargo.toml b/Cargo.toml index 94bb019..4730892 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pulldown-cmark-to-cmark" -version = "6.0.3" +version = "6.0.4" authors = ["Sebastian Thiel <byronimo@gmail.com>", "Dylan Owen <dyltotheo@gmail.com>"] description = "Convert pulldo...
1
1
1
1a407920006e554a4533c2ed9de1fe3bae57f146
Tavian Barnes
2021-09-24T17:07:08
Don't output extra newlines after HTML before a SoftBreak Fixes #28.
diff --git a/src/lib.rs b/src/lib.rs index 4b35930..0fac66f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -201,6 +201,7 @@ where Html(_) => { /* no newlines if HTML continues */ } Text(_) => { /* no newlines for inline HTML */ } End(_) => { /* no newlines if ending a pre...
2
2
1
100c41a1106032ee84c8fcdbcf788cd4426573a5
Sebastian Thiel
2021-09-07T07:46:13
Release pulldown-cmark-to-cmark v6.0.3
diff --git a/Cargo.toml b/Cargo.toml index c877e4d..94bb019 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pulldown-cmark-to-cmark" -version = "6.0.2" +version = "6.0.3" authors = ["Sebastian Thiel <byronimo@gmail.com>", "Dylan Owen <dyltotheo@gmail.com>"] description = "Convert pulldo...
1
1
1
9f8f17ba67b6f2c6d0ed1eb849f5cadc7c6fcef0
blepabyte
2021-09-07T01:39:24
Handle spaces in link URIs
diff --git a/src/lib.rs b/src/lib.rs index 0c552ab..4b35930 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -318,11 +318,15 @@ where } End(ref tag) => match tag { Image(_, ref uri, ref title) | Link(_, ref uri, ref title) => { - if title.is_empty() { - ...
1
7
3
c1cd8ce70ce1f7cda2f1f55afb60ea92676b223b
Sebastian Thiel
2021-06-23T12:00:13
(cargo-release) version 6.0.2
diff --git a/Cargo.toml b/Cargo.toml index 159c7b3..c877e4d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pulldown-cmark-to-cmark" -version = "6.0.1" +version = "6.0.2" authors = ["Sebastian Thiel <byronimo@gmail.com>", "Dylan Owen <dyltotheo@gmail.com>"] description = "Convert pulldo...
1
1
1
6bc1f11eeb311183ff3537f60d324177a6d10bfa
Sebastian Thiel
2021-06-23T11:55:39
Adjust test expecations - it's probably more correct now
diff --git a/tests/fmt.rs b/tests/fmt.rs index fb8239f..e3cb00d 100644 --- a/tests/fmt.rs +++ b/tests/fmt.rs @@ -275,11 +275,11 @@ mod blockquote { assert_events_eq(s); - assert_eq!(fmts(s).0, "\n > \n > <table>\n > </table>\n > \n") + assert_eq!(fmts(s).0, "\n > \n > <table>\n > </table>\n >...
1
2
2
77821898001b0a89e030464719256b943218b810
Sebastian Thiel
2021-06-04T02:16:49
(cargo-release) version 6.0.1
diff --git a/Cargo.toml b/Cargo.toml index 2e450d5..159c7b3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pulldown-cmark-to-cmark" -version = "6.0.0" +version = "6.0.1" authors = ["Sebastian Thiel <byronimo@gmail.com>", "Dylan Owen <dyltotheo@gmail.com>"] description = "Convert pulldo...
1
1
1
7fdf0dac696e609be6cbb6c0cd78c0f9c4f24b64
Sebastian Thiel
2021-06-04T02:02:27
Also escape closing brackets (oversight); fixes #25
diff --git a/src/lib.rs b/src/lib.rs index 0278795..55744a0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,7 +1,7 @@ use pulldown_cmark::{Alignment as TableAlignment, Event}; use std::{borrow::Borrow, borrow::Cow, fmt}; -pub const SPECIAL_CHARACTERS: &[u8; 9] = br#"#\_*<>`|["#; +pub const SPECIAL_CHARACTERS: &[u8] ...
2
12
4
65f59491389db1ac5e820412455c810ecda019f9
Sebastian Thiel
2021-05-02T05:17:27
Allow the commonmark-spec test to fail right now… …which should enable continuous improvements in the time to come.
diff --git a/tests/spec.rs b/tests/spec.rs index 8e8d44d..e582e62 100644 --- a/tests/spec.rs +++ b/tests/spec.rs @@ -75,6 +75,7 @@ fn test_roundtrip(original: &str, expected: &str) -> bool { } #[test] +#[should_panic] // at the time of writing, 60% of tests pass. This needs considerable work. fn commonmark_spec() ...
1
1
0
59db24fb51c2e0a441a083b0129cfae9cce1f48f
Sebastian Thiel
2021-03-31T04:23:36
dependency update
diff --git a/Cargo.toml b/Cargo.toml index 8b0238b..2e450d5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,4 +18,4 @@ pulldown-cmark = { version = "0.8.0", default-features = false } [dev-dependencies] indoc = "1.0.0" -pretty_assertions = "0.6.1" +pretty_assertions = "0.7.1"
1
1
1
cac031a3b4acd3a179c56e2537217c3c4c27a16c
Sebastian Thiel
2021-01-21T04:14:04
Use modern doc string type links
diff --git a/src/lib.rs b/src/lib.rs index 86616fb..0278795 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,10 +3,8 @@ use std::{borrow::Borrow, borrow::Cow, fmt}; pub const SPECIAL_CHARACTERS: &[u8; 9] = br#"#\_*<>`|["#; -/// Similar to [Pulldown-Cmark-Alignment][pd-alignment], but with required +/// Similar to [P...
1
7
12
16e66da8308f66e38d9821f51c09b1cde1d5802b
Sebastian Thiel
2021-01-21T03:22:05
thanks clippy
diff --git a/src/lib.rs b/src/lib.rs index d136347..86616fb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -234,16 +234,13 @@ where .and_then(|_| formatter.write_char('`')) } Start(ref tag) => { - match *tag { - List(ref list_type) => { - ...
1
10
13
9d2dc9082088845a9eecdae9ac7b1c4a4a096f78
Sebastian Thiel
2021-01-21T03:14:46
cargo fmt
diff --git a/src/lib.rs b/src/lib.rs index 058f0eb..d136347 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -312,10 +312,12 @@ where Ok(()) }; - s.and_then(|_| formatter.write_str(&"`".repeat(options.code_block_backticks))) - ...
1
6
4
3ae8ddc6d04806adc68bf7474b18afba11c06d06
Laurențiu Nicola
2020-10-13T15:09:38
Bump pulldown-cmark
diff --git a/Cargo.toml b/Cargo.toml index 92c7feb..8b0238b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pulldown-cmark-to-cmark" -version = "5.0.0" +version = "6.0.0" authors = ["Sebastian Thiel <byronimo@gmail.com>", "Dylan Owen <dyltotheo@gmail.com>"] description = "Convert pulldo...
3
9
9
ba51fdae86390a2db7324a2d469d79de541ffdfa
Sebastian Thiel
2020-09-01T02:40:22
update dependencies
diff --git a/Cargo.toml b/Cargo.toml index 216b309..92c7feb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,5 +17,5 @@ include = ["src/lib.rs", "README.md", "CHANGELOG.md"] pulldown-cmark = { version = "0.7.0", default-features = false } [dev-dependencies] -indoc = "0.3.4" +indoc = "1.0.0" pretty_assertions = "0.6...
1
1
1
a5f644a904bc2e343dd2d8e88235eba0a4ab6345
Sebastian Thiel
2020-08-02T05:08:28
(cargo-release) version 5.0.0
diff --git a/Cargo.toml b/Cargo.toml index 7999139..216b309 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pulldown-cmark-to-cmark" -version = "4.0.2" +version = "5.0.0" authors = ["Sebastian Thiel <byronimo@gmail.com>", "Dylan Owen <dyltotheo@gmail.com>"] description = "Convert pulldo...
1
1
1
c9267b55bebaff48f27e04d64da239607b7fdb4d
Zac Pullar-Strecker
2020-08-02T02:42:13
Make the number of backticks in codeblocks configurable This is a breaking change because it adds a member to the publically constructable `Options` struct.
diff --git a/src/lib.rs b/src/lib.rs index 0c38ab5..058f0eb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -68,6 +68,7 @@ pub struct Options { pub newlines_after_list: usize, pub newlines_after_blockquote: usize, pub newlines_after_rest: usize, + pub code_block_backticks: usize, } impl Default for Op...
1
5
3
8774c4397676673db370ac1cafdbacfb81bdf02c
Jan-Erik Rediger
2020-06-02T10:00:04
Avoid integer underflow After the previous change this is mostly a defensive measure. Nonetheless it should not panic even if we still miss a case.
diff --git a/src/lib.rs b/src/lib.rs index 0787f29..0c38ab5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -383,7 +383,7 @@ where formatter.write_char('|')?; // NOTE: For perfect counting, count grapheme clusters. // The reason this is ...
1
1
1
8618b3dcc1380efd6215a1bd53e3e3817d34b1df
Sebastian Thiel
2020-05-26T14:04:01
Run `cargo diet`
diff --git a/Cargo.toml b/Cargo.toml index 8432820..ad971cf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,8 +10,8 @@ repository = "https://github.com/Byron/pulldown-cmark-to-cmark" homepage = "https://github.com/Byron/pulldown-cmark-to-cmark" documentation = "https://docs.rs/crate/pulldown-cmark-to-cmark" readme =...
1
1
1
03f4ab8cde0172fa21d0419eec54fd72294df64d
Sebastian Thiel
2020-05-15T03:22:29
bump patch level
diff --git a/Cargo.toml b/Cargo.toml index 6b8ec71..8432820 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pulldown-cmark-to-cmark" -version = "4.0.0" +version = "4.0.1" authors = ["Sebastian Thiel <byronimo@gmail.com>", "Dylan Owen <dyltotheo@gmail.com>"] description = "Convert pulldo...
1
1
1
0b414d08b65ac1a7ccdf16994beb5d02a10b6044
Sebastian Thiel
2020-04-22T00:57:09
Use Rust Edition 2018 QoL improvements
diff --git a/tests/display.rs b/tests/display.rs index 603a3fa..3bd663b 100644 --- a/tests/display.rs +++ b/tests/display.rs @@ -1,6 +1,3 @@ -extern crate pulldown_cmark; -extern crate pulldown_cmark_to_cmark; - use pulldown_cmark::Event; use pulldown_cmark_to_cmark::fmt; diff --git a/tests/fmt.rs b/tests/fmt.rs in...
2
0
6
59c5a3b8466c7967f1aa04d2c1fd9e42b366017d
Sebastian Thiel
2020-04-22T00:52:55
Move last_was_html into state definition (allowing resumes)
diff --git a/src/fmt.rs b/src/fmt.rs index af1b2e0..557ab59 100644 --- a/src/fmt.rs +++ b/src/fmt.rs @@ -1,7 +1,5 @@ use pulldown_cmark::{Alignment as TableAlignment, Event}; -use std::borrow::Borrow; -use std::borrow::Cow; -use std::fmt; +use std::{borrow::Borrow, borrow::Cow, fmt}; pub const SPECIAL_CHARACTERS: &...
3
28
18
5b1c7c6cabf79d193b73b5a6d16218c59c94e727
Jan-Erik Rediger
2020-04-06T12:28:42
Update tests to use new code block kind
diff --git a/tests/display.rs b/tests/display.rs index cec7733..c59820f 100644 --- a/tests/display.rs +++ b/tests/display.rs @@ -35,6 +35,7 @@ mod start { use pulldown_cmark::Event::*; use pulldown_cmark::LinkType::*; use pulldown_cmark::Tag::*; + use pulldown_cmark::CodeBlockKind; #[test] ...
2
7
5
01746716d7256c9e2251abd5f10cb25d8ab3034e
Jan-Erik Rediger
2020-04-06T08:14:38
Expose pulldown_cmark dependency to users To make any good use of this crate people need to use `pulldown_cmark` anyway. Additionally they need to match the same version. We can simply expose the direct dependency on it and people can then use it: use pulldown_cmark_to_cmark::pulldown_cmark;
diff --git a/src/lib.rs b/src/lib.rs index 2d5e800..82a56b2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,3 @@ -extern crate pulldown_cmark; +pub extern crate pulldown_cmark; pub mod fmt;
1
1
1
5786f7e491770f5b050c62394179b7a648dd1271
Jan-Erik Rediger
2020-04-06T08:14:21
Upgrade cmark dependency and handle new code block
diff --git a/Cargo.toml b/Cargo.toml index bd653f5..37fe9db 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ exclude = ["tests", "examples"] edition = "2018" [dependencies] -pulldown-cmark = {version = "0.6.1", default-features = false} +pulldown-cmark = { version = "0.7.0", default-features = false } ...
2
10
2
63ac5ca0446734373c2d88d4e7df8417dcc485b2
Sebastian Thiel
2020-01-31T10:52:27
Bump patch
diff --git a/Cargo.toml b/Cargo.toml index 2c18592..bd653f5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pulldown-cmark-to-cmark" -version = "2.0.0" +version = "2.0.1" authors = ["Sebastian Thiel <byronimo@gmail.com>", "Dylan Owen <dyltotheo@gmail.com>"] description = "Convert pulldo...
1
1
1
b3dce1a9cc1650f0c354efa35d154231089cb5df
Sebastian Thiel
2020-01-31T10:51:50
Dumber, byte oriented escape code Probably also generates less code
diff --git a/src/fmt.rs b/src/fmt.rs index f558371..91887d0 100644 --- a/src/fmt.rs +++ b/src/fmt.rs @@ -3,7 +3,7 @@ use std::borrow::Borrow; use std::borrow::Cow; use std::fmt; -pub const SPECIAL_CHARACTERS: &str = r#"#\_*<>`|["#; +pub const SPECIAL_CHARACTERS: &[u8; 9] = br#"#\_*<>`|["#; /// Similar to [Pulldo...
2
16
16
c6fb144d64db6ff1229c0d2d98f789abdfac57b3
Sebastian Thiel
2020-01-31T10:29:25
Upgrade to edition 2018
diff --git a/Cargo.toml b/Cargo.toml index e9ae0be..2c18592 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,7 @@ homepage = "https://github.com/Byron/pulldown-cmark-to-cmark" documentation = "https://docs.rs/crate/pulldown-cmark-to-cmark" readme = "README.md" exclude = ["tests", "examples"] +edition = "2018" ...
3
7
5
17e9f4ed5ec5ae168a41ea6c29ec4b5ccf51369e
Sebastian Thiel
2020-01-31T10:26:02
Optimize release
diff --git a/Cargo.toml b/Cargo.toml index b58a551..e9ae0be 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,7 @@ repository = "https://github.com/Byron/pulldown-cmark-to-cmark" homepage = "https://github.com/Byron/pulldown-cmark-to-cmark" documentation = "https://docs.rs/crate/pulldown-cmark-to-cmark" readme =...
1
1
0
91df9a24c160d32b2cc97fbebb9533fef1e0cc35
Sebastian Thiel
2020-01-31T09:24:54
Add support for escapes, fixes #8
diff --git a/src/fmt.rs b/src/fmt.rs index 0ea4cf2..8c8cb1e 100644 --- a/src/fmt.rs +++ b/src/fmt.rs @@ -3,6 +3,8 @@ use std::borrow::Borrow; use std::borrow::Cow; use std::fmt; +pub const SPECIAL_CHARACTERS: &str = r#"#\_*<>`|"#; + /// Similar to [Pulldown-Cmark-Alignment][pd-alignment], but with required /// tr...
2
166
12
d68f0335136d1a38f15bbcff2cc31e4bc382a81f
Sebastian Thiel
2020-01-31T08:04:00
Run cargo fmt
diff --git a/src/fmt.rs b/src/fmt.rs index f91033b..0ea4cf2 100644 --- a/src/fmt.rs +++ b/src/fmt.rs @@ -172,7 +172,7 @@ where state.newlines_before_start = options.newlines_after_rule; } formatter.write_str("---") - }, + } Code(r...
2
44
42
d64853c519e319b4c74164f3611aa6b54e23bae0
Sebastian Thiel
2020-01-31T07:51:10
Bump our version to 2.0 Our dependencies bumped their minor prior to release, a breaking change.
diff --git a/Cargo.toml b/Cargo.toml index ec146f2..b58a551 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pulldown-cmark-to-cmark" -version = "1.2.4" +version = "2.0.0" authors = ["Sebastian Thiel <byronimo@gmail.com>", "Dylan Owen <dyltotheo@gmail.com>"] description = "Convert pulldo...
1
1
1
ebd8e8e7c6b8bfe39f1435876ed7131dc3042ee6
Sebastian Thiel
2019-12-02T00:55:20
bump version to 1.2.4
diff --git a/Cargo.toml b/Cargo.toml index 12b0e16..fc9696d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pulldown-cmark-to-cmark" -version = "1.2.3" +version = "1.2.4" authors = ["Sebastian Thiel <byronimo@gmail.com>", "Dylan Owen <dyltotheo@gmail.com>"] description = "Convert pulldo...
1
1
1
58e51373d1d517fc5e3f71ab1540411d17c87d2d
Dylan Owen
2019-12-01T22:17:56
updated authors
diff --git a/Cargo.toml b/Cargo.toml index d3fdb4b..12b0e16 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "pulldown-cmark-to-cmark" version = "1.2.3" -authors = ["Sebastian Thiel <byronimo@gmail.com>"] +authors = ["Sebastian Thiel <byronimo@gmail.com>", "Dylan Owen <dyltotheo@gmail.com>"]...
1
1
1
2dd8024ba73860efcc41f637696dd0b8fdf1c42f
Dylan Owen
2019-11-23T21:11:05
added blockquote test cases
diff --git a/tests/fmt.rs b/tests/fmt.rs index aa33f11..a993cdb 100644 --- a/tests/fmt.rs +++ b/tests/fmt.rs @@ -319,6 +319,21 @@ mod blockquote { " > a\n > > \n > > b\n > \n > c", ) } + + #[test] + fn initially_nested() { + assert_eq!( + fmts(indoc!( + ...
1
34
0
6f2382ef118afcbebe558034f63a5825870cf60b
Sebastian Thiel
2019-10-28T06:56:12
Bump version
diff --git a/Cargo.toml b/Cargo.toml index 3ceb3c8..d3fdb4b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pulldown-cmark-to-cmark" -version = "1.2.2" +version = "1.2.3" authors = ["Sebastian Thiel <byronimo@gmail.com>"] description = "Convert pulldown-cmark Events back to the string t...
1
1
1
83fdbc084d03a85108b13be83cf236f38e9b167e
Sebastian Thiel
2019-10-28T06:54:23
Better approximation of contained characters
diff --git a/src/fmt.rs b/src/fmt.rs index 9fa2d5a..9335d5c 100644 --- a/src/fmt.rs +++ b/src/fmt.rs @@ -303,7 +303,9 @@ where .zip(state.table_headers.iter()) { formatter.write_char('|')?; - let last_minus_one...
1
3
1
00442f9df50059c9c2560086dc3c082c763718d4
Sebastian Thiel
2019-10-28T06:52:16
Assure to never have truly empty header fields Please note that there may be other issues with headers of length 1 and center alignment. Currently properly printing center alignment depends on the header to at least be two bytes long. Fixes #5
diff --git a/src/fmt.rs b/src/fmt.rs index 5582991..9fa2d5a 100644 --- a/src/fmt.rs +++ b/src/fmt.rs @@ -42,6 +42,10 @@ pub struct State<'a> { pub table_alignments: Vec<Alignment>, /// Keeps the current table headers, if we are currently serializing a table. pub table_headers: Vec<String>, + /// If se...
2
33
15
83c6edc8f63c1780985c3c1b80a6e24260da6d58
Sebastian Thiel
2019-07-03T09:28:48
minor version bump
diff --git a/Cargo.toml b/Cargo.toml index de33fed..3ceb3c8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pulldown-cmark-to-cmark" -version = "1.2.1" +version = "1.2.2" authors = ["Sebastian Thiel <byronimo@gmail.com>"] description = "Convert pulldown-cmark Events back to the string t...
1
1
1
27909e0318095a03b55dab2c81a44601a1f46981
Sebastian Thiel
2019-07-03T08:49:07
Upgrade to pulldown-cmark 0.4
diff --git a/Cargo.toml b/Cargo.toml index 365b10f..fc52eea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pulldown-cmark-to-cmark" -version = "1.2.0" +version = "1.2.1" authors = ["Sebastian Thiel <byronimo@gmail.com>"] description = "Convert pulldown-cmark Events back to the string t...
1
1
1
90f134ee042614421da3cafc97bee264cbdda2b3
Carol (Nichols || Goulding)
2019-05-18T02:00:17
Add a test that generated markdown parses equivalently Even though the spaces are stripped from within the table cells, the pulldown-cmark events generated should be the same for the original markdown and the markdown produced by pulldown-cmark-to-cmark.
diff --git a/tests/fmt.rs b/tests/fmt.rs index 7801a93..ed04b7d 100644 --- a/tests/fmt.rs +++ b/tests/fmt.rs @@ -424,6 +424,35 @@ mod table { } ) } + #[test] + fn it_generates_equivalent_table_markdown() { + use pulldown_cmark::{Options, Parser}; + + let original_table_mar...
1
29
0
9a87b4e328766b8754b686a8344f7155aae37c8d
Andy Russell
2019-04-20T18:03:50
upgrade to pulldown-cmark 0.4.1
diff --git a/Cargo.toml b/Cargo.toml index 3604780..365b10f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ documentation = "https://docs.rs/crate/pulldown-cmark-to-cmark" readme = "README.md" [dependencies] -pulldown-cmark = {version = "0.2.0", default-features = false} +pulldown-cmark = {version = "0.4...
4
62
27
108c355c252d4b2dd420812ee63cd6f002a66c95
Sebastian Thiel
2018-12-20T16:10:02
Bump version after supporting the latest pulldown-cmark 0.2
diff --git a/Cargo.toml b/Cargo.toml index 74b69e9..3604780 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pulldown-cmark-to-cmark" -version = "1.1.0" +version = "1.2.0" authors = ["Sebastian Thiel <byronimo@gmail.com>"] description = "Convert pulldown-cmark Events back to the string t...
1
1
1
5c7ddd5321cc39327d94ea6f9f64c4f6bd750fd5
Malte Brandy
2018-12-20T13:59:00
Bump dependency versions
diff --git a/Cargo.toml b/Cargo.toml index 9c1f808..74b69e9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ documentation = "https://docs.rs/crate/pulldown-cmark-to-cmark" readme = "README.md" [dependencies] -pulldown-cmark = {version = "0.1.0", default-features = false} +pulldown-cmark = {version = "0.2...
1
2
2
ba3d3133105eb5ca98dc808b224d1ad428fedb95
Sebastian Thiel
2018-02-13T18:44:45
Bump minor
diff --git a/Cargo.toml b/Cargo.toml index 7fd349f..9c1f808 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pulldown-cmark-to-cmark" -version = "1.0.0" +version = "1.1.0" authors = ["Sebastian Thiel <byronimo@gmail.com>"] description = "Convert pulldown-cmark Events back to the string t...
1
1
1
f315ab75743e40607acc1010514cad4d8b1eabc3
Sebastian Thiel
2018-02-11T09:20:19
First bunch of API docs
diff --git a/src/fmt.rs b/src/fmt.rs index a5560a7..99e9865 100644 --- a/src/fmt.rs +++ b/src/fmt.rs @@ -3,7 +3,11 @@ use std::borrow::Borrow; use std::borrow::Cow; use pulldown_cmark::{Alignment as TableAlignment, Event}; -#[derive(Copy, Clone, Debug, PartialEq, Eq)] +/// Similar to [Pulldown-Cmark-Alignment][pd-a...
1
81
43
2040f4702703c68c294f22339554ed2297f7f455
Theo Buehler
2021-09-14T02:26:58
Add a cast to allow building on ILP32 systems (#101) On architectures where `c_long` is an `i32`, e.g., OpenBSD/i386, the comparison between `ret` and `u32::MAX as i64` is a type error. Add a cast to satisfy the type checker on such architectures. This cast is a noop on systems where `c_long` is an `i64`.
diff --git a/lib.rs b/lib.rs index b8a25e3..7640281 100644 --- a/lib.rs +++ b/lib.rs @@ -539,7 +539,7 @@ pub fn cpu_num() -> Result<u32, Error> { #[cfg(any(target_os = "solaris", target_os = "illumos", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd"))] { let ret = unsafe { libc::sy...
1
1
1
ce3d51646ffc3f2c90fb5b42f50626dba10b37f4
Michael Duane Mooring
2021-06-24T05:59:20
Rust Nightly fix (#99) * Rust Nightly fix * needs last return * or not * needs last return
diff --git a/lib.rs b/lib.rs index e27469e..b8a25e3 100644 --- a/lib.rs +++ b/lib.rs @@ -825,7 +825,7 @@ pub fn boottime() -> Result<timeval, Error> { .collect::<Vec<f64>>(); bt.tv_sec = secs[0] as libc::time_t; bt.tv_usec = secs[1] as libc::suseconds_t; - Ok(bt) + return Ok(bt); ...
1
9
6
51fa4fa4669a006a976e87f404f5a4e1a061e31a
Jan-Erik Rediger
2021-03-10T10:26:26
Test: check os-release on Linux only
diff --git a/test/src/main.rs b/test/src/main.rs index a1659f8..e80cd27 100644 --- a/test/src/main.rs +++ b/test/src/main.rs @@ -23,7 +23,7 @@ fn main() { let t = boottime().unwrap(); println!("boottime {} sec, {} usec", t.tv_sec, t.tv_usec); } - #[cfg(not(target_os = "windows"))] + #[cfg(t...
1
1
1
af8304b37f0c796bb3dc9395e5eb6c94d6e824b7
Jan-Erik Rediger
2021-03-10T10:04:40
Add missing "homepage"
diff --git a/lib.rs b/lib.rs index b1769b8..2e50189 100644 --- a/lib.rs +++ b/lib.rs @@ -203,7 +203,7 @@ pub struct LinuxOSReleaseInfo { /// Examples: "server", "embedded". pub variant_id: Option<String>, - /// HOME_URL= should refer to the of the operating system, or alternatively some homepage of + ...
1
1
1
88491d1a3a7b63c95416600850f1776198339830
Jan-Erik Rediger
2021-03-10T09:57:20
minites -> minutes
diff --git a/lib.rs b/lib.rs index eb871e2..b1769b8 100644 --- a/lib.rs +++ b/lib.rs @@ -41,11 +41,11 @@ static OS_KERN_BOOTTIME: libc::c_int = 21; #[repr(C)] #[derive(Debug)] pub struct LoadAvg { - /// Average load within one minite. + /// Average load within one minutes. pub one: f64, - /// Average l...
1
3
3
87029bf1dfe6d5a9f65c6f658e3473e129db7561
Jacob O'Toole
2021-01-04T22:13:01
Add linux_os_release to test/src/main.rs
diff --git a/test/src/main.rs b/test/src/main.rs index 5002273..a1659f8 100644 --- a/test/src/main.rs +++ b/test/src/main.rs @@ -23,5 +23,7 @@ fn main() { let t = boottime().unwrap(); println!("boottime {} sec, {} usec", t.tv_sec, t.tv_usec); } + #[cfg(not(target_os = "windows"))] + println...
1
2
0
ccc34bda0f6e172e45906f33f7b26b811fa2bc57
Jacob O'Toole
2021-01-04T17:55:16
linux os-release: Add privacy_policy_url, methods for default values and doc comments.
diff --git a/lib.rs b/lib.rs index 76bacd5..eb871e2 100644 --- a/lib.rs +++ b/lib.rs @@ -66,30 +66,211 @@ pub struct MemInfo { pub swap_free: u64, } -/// The os release info of Linux +/// The os release info of Linux. +/// +/// See [man os-release](https://www.freedesktop.org/software/systemd/man/os-release.htm...
1
190
5
95928654a65a5ad8a4f221a743036d99f1bdda86
YadominJinta
2020-07-12T17:13:06
Fix build for target android
diff --git a/lib.rs b/lib.rs index c441271..689a43d 100644 --- a/lib.rs +++ b/lib.rs @@ -621,7 +621,7 @@ pub fn boottime() -> Result<timeval, Error> { tv_usec: 0 }; - #[cfg(target_os = "linux")] + #[cfg(any(target_os = "linux", target_os="android"))] { let mut s = String::new(); ...
1
1
1
bf809d6fbb70cc595f15bdedc16fead55b49190f
Kishan
2020-06-16T11:30:44
Change a cfg line so clippy on beta won't complain
diff --git a/lib.rs b/lib.rs index a97d4f1..c441271 100644 --- a/lib.rs +++ b/lib.rs @@ -735,7 +735,7 @@ mod test { } #[test] - #[cfg(linux)] + #[cfg(target_os = "linux")] pub fn test_linux_os_release() { let os_release = linux_os_release().unwrap(); println!("linux_os_release()...
1
1
1
bc09775b2ad6413b8a4478a33992f61834c82f38
Simon Schürrle
2020-02-18T12:43:52
Make use of conditional compilation instead of cfg! Fixes #42
diff --git a/lib.rs b/lib.rs index 11b3547..e13f95f 100644 --- a/lib.rs +++ b/lib.rs @@ -390,8 +390,8 @@ pub fn disk_info() -> Result<DiskInfo, Error> { } /// Get hostname. +#[cfg(target_family = "unix")] pub fn hostname() -> Result<String, Error> { - if cfg!(unix) { unsafe { let buf_size ...
1
10
10
6d767a5abc91930a55ca8c409806f8588524c8cd
Igor Raits
2020-02-15T10:38:40
Cast gethostname() arguments to a proper type Closes: https://github.com/FillZpp/sys-info-rs/issues/43 Signed-off-by: Igor Raits <i.gnatenko.brain@gmail.com>
diff --git a/lib.rs b/lib.rs index b26bb9f..11b3547 100644 --- a/lib.rs +++ b/lib.rs @@ -395,10 +395,10 @@ pub fn hostname() -> Result<String, Error> { unsafe { let buf_size = libc::sysconf(libc::_SC_HOST_NAME_MAX) as usize; let mut buf = Vec::<u8>::with_capacity(buf_size + 1); - ...
1
2
2
ef69500f918d6eaee21287d807432bfdf0a06376
Hristo Venev
2020-01-20T21:23:12
use gethostname() in hostname() The hostname command might not be installed.
diff --git a/lib.rs b/lib.rs index 3e56eb1..b26bb9f 100644 --- a/lib.rs +++ b/lib.rs @@ -391,13 +391,19 @@ pub fn disk_info() -> Result<DiskInfo, Error> { /// Get hostname. pub fn hostname() -> Result<String, Error> { - use std::process::Command; if cfg!(unix) { - Command::new("hostname") - ...
1
11
5
46ab6666ca7ffd50c15e9413e94a223552ff770c
Siyu Wang
2019-09-16T02:36:02
fix cpu_speed for ppc64 (#40) Signed-off-by: Siyu Wang <FillZpp.pub@gmail.com>
diff --git a/lib.rs b/lib.rs index 1d8825d..3e56eb1 100644 --- a/lib.rs +++ b/lib.rs @@ -271,14 +271,15 @@ pub fn cpu_speed() -> Result<u64, Error> { let mut s = String::new(); File::open("/proc/cpuinfo")?.read_to_string(&mut s)?; - let mut find_cpu_mhz = s.split('\n').find(|line| line.starts...
1
7
6
57a2ec4486652eabe5c60705896d9b93bf1fb843
Ana Hobden
2019-05-28T01:54:02
Fix windows test. (#32) Signed-off-by: Ana Hobden <operator@hoverbear.org>
diff --git a/lib.rs b/lib.rs index b7ddc77..bccfdb0 100644 --- a/lib.rs +++ b/lib.rs @@ -413,6 +413,7 @@ mod test { } #[test] + #[cfg(not(windows))] pub fn test_boottime() { let bt = boottime().unwrap(); println!("boottime(): {} {}", bt.tv_sec, bt.tv_usec);
1
1
0
3bd9136fcf692d1cf16e0026059ca224bb934108
Ana Hobden
2019-05-28T01:53:50
Workaround old (pre-3.4) kernels and/or WSL installs. (#33) Signed-off-by: Ana Hobden <operator@hoverbear.org>
diff --git a/lib.rs b/lib.rs index 1746662..b7ddc77 100644 --- a/lib.rs +++ b/lib.rs @@ -258,14 +258,25 @@ pub fn mem_info() -> Result<MemInfo, Error> { meminfo_hashmap.insert(label, value); } } + let total = *meminfo_hashmap.get("MemTotal").ok_or(Error::Unknown)?; + ...
1
18
7
8211eea716a4b903f92f4408df04f820e1571a9a
Igor Gnatenko
2017-12-08T05:51:03
port to cc crate (#21) Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
diff --git a/Cargo.toml b/Cargo.toml index 6afe81a..2437fdf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ name = "sys_info" path = "lib.rs" [build-dependencies] -gcc = "0.3.51" +cc = "1" [dependencies] libc = "0.2.29" diff --git a/build.rs b/build.rs index c09ab88..04f2871 100644 --- a/build.rs +++...
2
7
5
ff0259e27f5a88ba473a3709b65671cdcc810d48
Igor Gnatenko
2017-12-08T05:50:50
make clippy a bit more happy (#22) Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
diff --git a/lib.rs b/lib.rs index 69619fd..1746662 100644 --- a/lib.rs +++ b/lib.rs @@ -253,7 +253,7 @@ pub fn mem_info() -> Result<MemInfo, Error> { let label = split_line.next(); let value = split_line.next(); if value.is_some() && label.is_some() { - let label =...
1
3
3
a7f034f11990a6d4b32dce9c013cec51206912b8
Siyu Wang
2017-12-08T05:50:08
fix issues/23 (#24)
diff --git a/lib.rs b/lib.rs index bf8217a..69619fd 100644 --- a/lib.rs +++ b/lib.rs @@ -179,12 +179,17 @@ pub fn cpu_speed() -> Result<u64, Error> { let mut s = String::new(); File::open("/proc/cpuinfo")?.read_to_string(&mut s)?; - s.split('\n') - .find(|line| line.starts_with("cp...
1
8
3
1b8fbe2ec5e4ba8445cb6f95c8ebd189d574bf51
Gleb Pomykalov
2017-11-22T03:11:08
Fix linux musl compilation (#20) * Fix compilation on musl linux * Fix conditional compilation
diff --git a/lib.rs b/lib.rs index c5dda9a..bf8217a 100644 --- a/lib.rs +++ b/lib.rs @@ -13,7 +13,7 @@ use std::io::{self, Read}; use std::fs::File; use std::os::raw::c_char; -#[cfg(not(windows))] +#[cfg(target_os = "macos")] use libc::sysctl; use libc::timeval; use std::mem::size_of_val; @@ -306,22 +306,25 @@ p...
1
9
6
646db23aa51c6bdbad000908c14f7c7163ec156f
pajowu
2017-11-08T07:28:37
Parse /proc/meminfo using labels (#15) OK, but i have to say, Linux kernel will not change /proc/meminfo existing field's name or sequence, otherwise it world be a disaster.
diff --git a/lib.rs b/lib.rs index bd13395..c5dda9a 100644 --- a/lib.rs +++ b/lib.rs @@ -19,6 +19,8 @@ use libc::timeval; use std::mem::size_of_val; use std::ptr::null_mut; +use std::collections::HashMap; + static MAC_CTL_KERN: libc::c_int = 1; static MAC_KERN_BOOTTIME: libc::c_int = 21; @@ -232,13 +234,6 @@ pu...
1
20
17
e433440a1d80ddae7d105819b4faa8fd4d321327
Waritnan Sookbuntherng
2017-11-08T06:57:42
Fix cross platform target build (#17)
diff --git a/build.rs b/build.rs index e530b30..c09ab88 100644 --- a/build.rs +++ b/build.rs @@ -1,14 +1,18 @@ extern crate gcc; +use std::env; + fn main() { - if cfg!(target_os = "linux") { - gcc::compile_library("libinfo.a", &["c/linux.c"]); - } else if cfg!(target_os = "macos") { - gcc::compi...
1
14
10
ea1f71ac5da39c8570c6a0842340e8d0df9ed59a
Waritnan Sookbuntherng
2017-11-08T06:31:36
Fix libc::sysctl missing on Windows builds (#18) thx
diff --git a/lib.rs b/lib.rs index 2069922..bd13395 100644 --- a/lib.rs +++ b/lib.rs @@ -13,6 +13,7 @@ use std::io::{self, Read}; use std::fs::File; use std::os::raw::c_char; +#[cfg(not(windows))] use libc::sysctl; use libc::timeval; use std::mem::size_of_val; @@ -295,6 +296,7 @@ pub fn hostname() -> Result<Stri...
1
2
0
939037b91e1702d8e5c8a09ba764f947b9b210b3
jiuzhu.wsy
2017-08-15T12:15:54
add denpendency gcc v0.3.51
diff --git a/Cargo.toml b/Cargo.toml index 60370e8..759dac7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,6 +22,6 @@ name = "sys_info" path = "lib.rs" [build-dependencies] -gcc = "*" +gcc = "0.3.51"
1
1
1
406546a10e2cef8488cec6d3f97d1f497a41583c
Priya Seth
2017-08-11T14:21:10
Changes for supporting ppc64le architecture
diff --git a/lib.rs b/lib.rs index 58998d9..ccdf8c6 100644 --- a/lib.rs +++ b/lib.rs @@ -8,7 +8,7 @@ use std::ffi; use std::io::Read; use std::fs::File; - +use std::os::raw::c_char; /// System load average value. #[repr(C)] @@ -78,7 +78,7 @@ pub fn os_type() -> Result<String, Error> { Ok(s) } else ...
1
3
3
a28b02a0e7e096672c6ad03e4ab4ddb95eb345cc
theduke
2017-01-09T08:48:14
Added tests.
diff --git a/lib.rs b/lib.rs index 3999cd6..804f4b8 100644 --- a/lib.rs +++ b/lib.rs @@ -283,3 +283,60 @@ pub fn hostname() -> Result<String, Error> { Err(Error::UnsupportedSystem) } } + +#[cfg(test)] +mod test { + use super::*; + + #[test] + pub fn test_os_type() { + let typ = os_type()....
1
57
0