Skip to content

This repository demonstrates that the line wrapping behavior for `comment_width` appears to be off by 1.

Notifications You must be signed in to change notification settings

InsertCreativityHere/rustfmt-comment-width-weirdness

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This repository configures the comment_width option of rustfmt to be 120 columns. However, in certain contexts, rustfmt seems to wrap comments after only 119 columns.

Doc comments on functions can up to the full 120 columns (as expected). But a doc comment on an enum variant can only go up to 119 columns.

To see this, run cargo +nightly fmt --check. You'll see that it tries to wrap the 120 column long comment on the enum variant. But the 120 column long comment on the function, and the 119 column long comment are fine.

About

This repository demonstrates that the line wrapping behavior for `comment_width` appears to be off by 1.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages