code_ownership 2.1.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. checksums.yaml +4 -4
  2. data/Cargo.lock +8 -14
  3. data/ext/cargo-vendor/magnus-0.8.2/.cargo-checksum.json +1 -0
  4. data/ext/cargo-vendor/magnus-0.8.2/.cargo_vcs_info.json +6 -0
  5. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/CHANGELOG.md +66 -1
  6. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/Cargo.lock +243 -9
  7. data/ext/cargo-vendor/magnus-0.8.2/Cargo.toml +277 -0
  8. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/Cargo.toml.orig +11 -6
  9. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/README.md +75 -23
  10. data/ext/cargo-vendor/magnus-0.8.2/build.rs +15 -0
  11. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/examples/complete_object/test/temperature_test.rb +4 -4
  12. data/ext/cargo-vendor/magnus-0.8.2/examples/inheritance.rs +66 -0
  13. data/ext/cargo-vendor/magnus-0.8.2/examples/mut_point.rs +116 -0
  14. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/api.rs +4 -3
  15. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/class.rs +9 -7
  16. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/encoding.rs +5 -5
  17. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/error.rs +12 -3
  18. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/fiber.rs +5 -5
  19. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/gc.rs +3 -3
  20. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/integer.rs +134 -0
  21. data/ext/cargo-vendor/magnus-0.8.2/src/io.rs +230 -0
  22. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/lib.rs +53 -54
  23. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/macros.rs +2 -2
  24. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/method.rs +14 -100
  25. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/module.rs +1 -1
  26. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/mutex.rs +1 -1
  27. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/r_array.rs +2 -2
  28. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/r_bignum.rs +100 -3
  29. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/r_hash.rs +63 -1
  30. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/r_string.rs +31 -231
  31. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/r_typed_data.rs +6 -9
  32. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/rb_sys.rs +4 -4
  33. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/scan_args.rs +3 -3
  34. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/thread.rs +16 -10
  35. data/ext/cargo-vendor/magnus-0.8.2/src/time.rs +462 -0
  36. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/try_convert.rs +64 -2
  37. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/typed_data.rs +113 -11
  38. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/value/flonum.rs +1 -1
  39. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/value.rs +83 -6
  40. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/test +1 -1
  41. data/ext/cargo-vendor/magnus-0.8.2/tests/hash.rs +44 -0
  42. data/ext/cargo-vendor/magnus-0.8.2/tests/io.rs +62 -0
  43. data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/return_iter.rs +1 -1
  44. data/ext/cargo-vendor/magnus-0.8.2/tests/string.rs +23 -0
  45. data/ext/cargo-vendor/magnus-0.8.2/tests/time.rs +71 -0
  46. data/ext/cargo-vendor/magnus-macros-0.8.0/.cargo-checksum.json +1 -0
  47. data/ext/cargo-vendor/magnus-macros-0.8.0/.cargo_vcs_info.json +6 -0
  48. data/ext/cargo-vendor/magnus-macros-0.8.0/Cargo.lock +47 -0
  49. data/ext/cargo-vendor/{magnus-macros-0.6.0 → magnus-macros-0.8.0}/Cargo.toml +10 -1
  50. data/ext/cargo-vendor/{magnus-macros-0.6.0 → magnus-macros-0.8.0}/Cargo.toml.orig +1 -1
  51. data/ext/cargo-vendor/magnus-macros-0.8.0/src/lib.rs +545 -0
  52. data/ext/cargo-vendor/{magnus-macros-0.6.0 → magnus-macros-0.8.0}/src/typed_data.rs +3 -3
  53. data/ext/cargo-vendor/{magnus-macros-0.6.0 → magnus-macros-0.8.0}/src/util.rs +1 -1
  54. data/ext/cargo-vendor/serde_magnus-0.10.0/.cargo-checksum.json +1 -0
  55. data/ext/cargo-vendor/serde_magnus-0.10.0/.cargo_vcs_info.json +6 -0
  56. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/Cargo.lock +77 -75
  57. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/Cargo.toml +3 -3
  58. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/Cargo.toml.orig +7 -4
  59. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/README.md +8 -5
  60. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/src/de/array_deserializer.rs +12 -8
  61. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/src/de/array_enumerator.rs +12 -7
  62. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/src/de/deserializer.rs +21 -18
  63. data/ext/cargo-vendor/serde_magnus-0.10.0/src/de/enum_deserializer.rs +35 -0
  64. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/src/de/hash_deserializer.rs +18 -11
  65. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/src/de/mod.rs +76 -76
  66. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/src/de/variant_deserializer.rs +10 -9
  67. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/src/error.rs +10 -4
  68. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/src/lib.rs +6 -5
  69. data/ext/cargo-vendor/serde_magnus-0.10.0/src/ser/enums.rs +11 -0
  70. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/src/ser/map_serializer.rs +11 -12
  71. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/src/ser/mod.rs +53 -50
  72. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/src/ser/seq_serializer.rs +11 -10
  73. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/src/ser/serializer.rs +50 -34
  74. data/ext/cargo-vendor/serde_magnus-0.10.0/src/ser/struct_serializer.rs +40 -0
  75. data/ext/cargo-vendor/serde_magnus-0.10.0/src/ser/struct_variant_serializer.rs +45 -0
  76. data/ext/cargo-vendor/serde_magnus-0.10.0/src/ser/tuple_variant_serializer.rs +38 -0
  77. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/tests/deserializing_arrays.rs +3 -3
  78. data/ext/cargo-vendor/serde_magnus-0.10.0/tests/deserializing_booleans.rs +15 -0
  79. data/ext/cargo-vendor/serde_magnus-0.10.0/tests/deserializing_enums.rs +39 -0
  80. data/ext/cargo-vendor/serde_magnus-0.10.0/tests/deserializing_floats.rs +12 -0
  81. data/ext/cargo-vendor/serde_magnus-0.10.0/tests/deserializing_integers.rs +18 -0
  82. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/tests/deserializing_maps.rs +3 -2
  83. data/ext/cargo-vendor/serde_magnus-0.10.0/tests/deserializing_options.rs +15 -0
  84. data/ext/cargo-vendor/serde_magnus-0.10.0/tests/deserializing_results.rs +17 -0
  85. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/tests/deserializing_strings.rs +7 -7
  86. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/tests/deserializing_structs.rs +9 -9
  87. data/ext/cargo-vendor/serde_magnus-0.10.0/tests/deserializing_tuples.rs +27 -0
  88. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/tests/deserializing_vecs.rs +3 -3
  89. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/tests/serializing_arrays.rs +3 -3
  90. data/ext/cargo-vendor/serde_magnus-0.10.0/tests/serializing_booleans.rs +15 -0
  91. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/tests/serializing_enums.rs +9 -7
  92. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/tests/serializing_floats.rs +2 -2
  93. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/tests/serializing_integers.rs +4 -4
  94. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/tests/serializing_maps.rs +3 -2
  95. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/tests/serializing_options.rs +3 -3
  96. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/tests/serializing_results.rs +5 -4
  97. data/ext/cargo-vendor/serde_magnus-0.10.0/tests/serializing_strings.rs +30 -0
  98. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/tests/serializing_structs.rs +15 -7
  99. data/ext/cargo-vendor/serde_magnus-0.10.0/tests/serializing_tuples.rs +35 -0
  100. data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/tests/serializing_vecs.rs +3 -3
  101. data/ext/code_ownership/Cargo.toml +2 -2
  102. data/ext/code_ownership/extconf.rb +2 -1
  103. data/ext/code_ownership/src/lib.rs +16 -16
  104. data/lib/code_ownership/cli.rb +1 -0
  105. data/lib/code_ownership/private/file_path_finder.rb +3 -7
  106. data/lib/code_ownership/private/file_path_team_cache.rb +5 -9
  107. data/lib/code_ownership/private/for_file_output_builder.rb +0 -1
  108. data/lib/code_ownership/private/team_finder.rb +8 -14
  109. data/lib/code_ownership/version.rb +2 -2
  110. data/lib/code_ownership.rb +12 -17
  111. metadata +182 -186
  112. data/ext/cargo-vendor/magnus-0.7.1/.cargo-checksum.json +0 -1
  113. data/ext/cargo-vendor/magnus-0.7.1/.cargo_vcs_info.json +0 -6
  114. data/ext/cargo-vendor/magnus-0.7.1/Cargo.toml +0 -95
  115. data/ext/cargo-vendor/magnus-0.7.1/build.rs +0 -5
  116. data/ext/cargo-vendor/magnus-0.7.1/examples/mut_point.rs +0 -60
  117. data/ext/cargo-vendor/magnus-0.7.1/src/time.rs +0 -190
  118. data/ext/cargo-vendor/magnus-0.7.1/tests/hash.rs +0 -25
  119. data/ext/cargo-vendor/magnus-0.7.1/tests/string.rs +0 -13
  120. data/ext/cargo-vendor/magnus-macros-0.6.0/.cargo-checksum.json +0 -1
  121. data/ext/cargo-vendor/magnus-macros-0.6.0/.cargo_vcs_info.json +0 -6
  122. data/ext/cargo-vendor/magnus-macros-0.6.0/src/lib.rs +0 -401
  123. data/ext/cargo-vendor/rb-sys-env-0.1.2/.cargo-checksum.json +0 -1
  124. data/ext/cargo-vendor/rb-sys-env-0.1.2/.cargo_vcs_info.json +0 -6
  125. data/ext/cargo-vendor/rb-sys-env-0.1.2/Cargo.toml +0 -25
  126. data/ext/cargo-vendor/rb-sys-env-0.1.2/Cargo.toml.orig +0 -14
  127. data/ext/cargo-vendor/rb-sys-env-0.1.2/LICENSE-APACHE +0 -190
  128. data/ext/cargo-vendor/rb-sys-env-0.1.2/LICENSE-MIT +0 -21
  129. data/ext/cargo-vendor/rb-sys-env-0.1.2/readme.md +0 -119
  130. data/ext/cargo-vendor/rb-sys-env-0.1.2/src/defines.rs +0 -37
  131. data/ext/cargo-vendor/rb-sys-env-0.1.2/src/lib.rs +0 -180
  132. data/ext/cargo-vendor/rb-sys-env-0.1.2/src/rb_env.rs +0 -110
  133. data/ext/cargo-vendor/rb-sys-env-0.1.2/src/ruby_version.rs +0 -163
  134. data/ext/cargo-vendor/rb-sys-env-0.1.2/src/utils.rs +0 -6
  135. data/ext/cargo-vendor/serde_magnus-0.9.0/.cargo-checksum.json +0 -1
  136. data/ext/cargo-vendor/serde_magnus-0.9.0/.cargo_vcs_info.json +0 -6
  137. data/ext/cargo-vendor/serde_magnus-0.9.0/src/de/enum_deserializer.rs +0 -30
  138. data/ext/cargo-vendor/serde_magnus-0.9.0/src/ser/enums.rs +0 -11
  139. data/ext/cargo-vendor/serde_magnus-0.9.0/src/ser/struct_serializer.rs +0 -36
  140. data/ext/cargo-vendor/serde_magnus-0.9.0/src/ser/struct_variant_serializer.rs +0 -37
  141. data/ext/cargo-vendor/serde_magnus-0.9.0/src/ser/tuple_variant_serializer.rs +0 -33
  142. data/ext/cargo-vendor/serde_magnus-0.9.0/tests/deserializing_booleans.rs +0 -18
  143. data/ext/cargo-vendor/serde_magnus-0.9.0/tests/deserializing_enums.rs +0 -39
  144. data/ext/cargo-vendor/serde_magnus-0.9.0/tests/deserializing_floats.rs +0 -12
  145. data/ext/cargo-vendor/serde_magnus-0.9.0/tests/deserializing_integers.rs +0 -18
  146. data/ext/cargo-vendor/serde_magnus-0.9.0/tests/deserializing_options.rs +0 -15
  147. data/ext/cargo-vendor/serde_magnus-0.9.0/tests/deserializing_results.rs +0 -17
  148. data/ext/cargo-vendor/serde_magnus-0.9.0/tests/deserializing_tuples.rs +0 -31
  149. data/ext/cargo-vendor/serde_magnus-0.9.0/tests/serializing_booleans.rs +0 -15
  150. data/ext/cargo-vendor/serde_magnus-0.9.0/tests/serializing_strings.rs +0 -30
  151. data/ext/cargo-vendor/serde_magnus-0.9.0/tests/serializing_tuples.rs +0 -27
  152. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/.cargo/config.toml +0 -0
  153. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/Gemfile +0 -0
  154. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/LICENSE +0 -0
  155. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/examples/complete_object/Rakefile +0 -0
  156. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/examples/complete_object/lib/temperature.rb +0 -0
  157. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/examples/custom_exception_ruby/Rakefile +0 -0
  158. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/examples/custom_exception_ruby/lib/ahriman/error.rb +0 -0
  159. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/examples/custom_exception_ruby/lib/ahriman.rb +0 -0
  160. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/examples/custom_exception_ruby/test/error_test.rb +0 -0
  161. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/examples/custom_exception_rust/Rakefile +0 -0
  162. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/examples/custom_exception_rust/lib/ahriman.rb +0 -0
  163. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/examples/custom_exception_rust/test/error_test.rb +0 -0
  164. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/examples/fibonacci.rs +0 -0
  165. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/examples/hello_world.rs +0 -0
  166. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/examples/point.rs +0 -0
  167. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/examples/rust_blank/Rakefile +0 -0
  168. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/examples/rust_blank/lib/rust_blank.rb +0 -0
  169. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/examples/rust_blank/test/bench.rb +0 -0
  170. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/examples/rust_blank/test/blank_test.rb +0 -0
  171. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/block.rs +0 -0
  172. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/embed.rs +0 -0
  173. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/enumerator.rs +0 -0
  174. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/exception.rs +0 -0
  175. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/float.rs +0 -0
  176. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/into_value.rs +0 -0
  177. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/numeric.rs +0 -0
  178. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/object.rs +0 -0
  179. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/process.rs +0 -0
  180. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/r_complex.rs +0 -0
  181. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/r_file.rs +0 -0
  182. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/r_float.rs +0 -0
  183. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/r_match.rs +0 -0
  184. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/r_object.rs +0 -0
  185. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/r_rational.rs +0 -0
  186. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/r_regexp.rs +0 -0
  187. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/r_struct.rs +0 -0
  188. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/range.rs +0 -0
  189. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/src/symbol.rs +0 -0
  190. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/allocate_before_init.rs +0 -0
  191. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/array_slice.rs +0 -0
  192. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/block_call.rs +0 -0
  193. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/bytes.rs +0 -0
  194. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/call_proc.rs +0 -0
  195. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/classname.rs +0 -0
  196. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/clone.rs +0 -0
  197. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/codepoints.rs +0 -0
  198. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/debug_exception.rs +0 -0
  199. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/encoding_capable.rs +0 -0
  200. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/enumerator.rs +0 -0
  201. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/enumeratorize.rs +0 -0
  202. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/float_convert_from_value.rs +0 -0
  203. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/float_convert_to_value.rs +0 -0
  204. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/fmt.rs +0 -0
  205. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/freeze.rs +0 -0
  206. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/integer_convert_to_value.rs +0 -0
  207. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/integer_traits.rs +0 -0
  208. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/ivar.rs +0 -0
  209. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/lazy_id.rs +0 -0
  210. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/make_proc.rs +0 -0
  211. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/proc_new.rs +0 -0
  212. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/range.rs +0 -0
  213. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/return_custom_error.rs +0 -0
  214. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/scan_args.rs +0 -0
  215. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/str.rs +0 -0
  216. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/struct.rs +0 -0
  217. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/symbol.rs +0 -0
  218. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/try_convert_array.rs +0 -0
  219. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/tuple_to_array.rs +0 -0
  220. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/typed_data.rs +0 -0
  221. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/typed_data_obj.rs +0 -0
  222. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/typed_data_subclass.rs +0 -0
  223. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/typed_data_subclass_from_ruby.rs +0 -0
  224. /data/ext/cargo-vendor/{magnus-0.7.1 → magnus-0.8.2}/tests/yield.rs +0 -0
  225. /data/ext/cargo-vendor/{magnus-macros-0.6.0 → magnus-macros-0.8.0}/LICENSE +0 -0
  226. /data/ext/cargo-vendor/{magnus-macros-0.6.0 → magnus-macros-0.8.0}/src/init.rs +0 -0
  227. /data/ext/cargo-vendor/{serde_magnus-0.9.0 → serde_magnus-0.10.0}/LICENSE +0 -0
@@ -0,0 +1,462 @@
1
+ //! Types and functions for working with Ruby's Time class.
2
+ //!
3
+ //! See also [`Ruby`](Ruby#time) for more Time related methods.
4
+
5
+ use std::{
6
+ fmt,
7
+ os::raw::c_int,
8
+ time::{Duration, SystemTime},
9
+ };
10
+
11
+ use rb_sys::{
12
+ rb_time_nano_new, rb_time_new, rb_time_timespec, rb_time_timespec_new, rb_time_utc_offset,
13
+ timespec, VALUE,
14
+ };
15
+
16
+ use crate::{
17
+ api::Ruby,
18
+ error::{protect, Error, IntoError},
19
+ into_value::IntoValue,
20
+ object::Object,
21
+ r_typed_data::RTypedData,
22
+ try_convert::TryConvert,
23
+ value::{
24
+ private::{self, ReprValue as _},
25
+ Fixnum, ReprValue, Value,
26
+ },
27
+ };
28
+
29
+ /// # `Time`
30
+ ///
31
+ /// Functions to create and work with Ruby `Time` objects.
32
+ ///
33
+ /// See also the [`Time`] type.
34
+ impl Ruby {
35
+ /// Create a new `Time` in the local timezone.
36
+ ///
37
+ /// # Examples
38
+ ///
39
+ /// ```
40
+ /// use magnus::{rb_assert, Error, Ruby};
41
+ ///
42
+ /// fn example(ruby: &Ruby) -> Result<(), Error> {
43
+ /// let t = ruby.time_new(1654013280, 0)?;
44
+ ///
45
+ /// rb_assert!(ruby, r#"t == Time.new(2022, 5, 31, 9, 8, 0, "-07:00")"#, t);
46
+ ///
47
+ /// Ok(())
48
+ /// }
49
+ /// # Ruby::init(example).unwrap()
50
+ /// ```
51
+ pub fn time_new(&self, seconds: i64, microseconds: i64) -> Result<Time, Error> {
52
+ protect(|| unsafe {
53
+ Time::from_rb_value_unchecked(rb_time_new(
54
+ seconds.try_into().unwrap(),
55
+ microseconds.try_into().unwrap(),
56
+ ))
57
+ })
58
+ }
59
+
60
+ /// Create a new `Time` with nanosecond resolution in the local timezone.
61
+ ///
62
+ /// # Examples
63
+ ///
64
+ /// ```
65
+ /// use magnus::{rb_assert, Error, Ruby};
66
+ ///
67
+ /// fn example(ruby: &Ruby) -> Result<(), Error> {
68
+ /// let t = ruby.time_nano_new(1654013280, 0)?;
69
+ ///
70
+ /// rb_assert!(ruby, r#"t == Time.new(2022, 5, 31, 9, 8, 0, "-07:00")"#, t);
71
+ ///
72
+ /// Ok(())
73
+ /// }
74
+ /// # Ruby::init(example).unwrap()
75
+ /// ```
76
+ pub fn time_nano_new(&self, seconds: i64, nanoseconds: i64) -> Result<Time, Error> {
77
+ protect(|| unsafe {
78
+ Time::from_rb_value_unchecked(rb_time_nano_new(
79
+ seconds.try_into().unwrap(),
80
+ nanoseconds.try_into().unwrap(),
81
+ ))
82
+ })
83
+ }
84
+
85
+ /// Create a new `Time` with nanosecond resolution with the given offset.
86
+ ///
87
+ /// # Examples
88
+ ///
89
+ /// ```
90
+ /// use magnus::{
91
+ /// error::IntoError,
92
+ /// rb_assert,
93
+ /// time::{Offset, Timespec},
94
+ /// Error, Ruby,
95
+ /// };
96
+ ///
97
+ /// fn example(ruby: &Ruby) -> Result<(), Error> {
98
+ /// let ts = Timespec {
99
+ /// tv_sec: 1654013280,
100
+ /// tv_nsec: 0,
101
+ /// };
102
+ /// let offset = Offset::from_hours(-7).map_err(|e| e.into_error(ruby))?;
103
+ /// let t = ruby.time_timespec_new(ts, offset)?;
104
+ ///
105
+ /// rb_assert!(ruby, r#"t == Time.new(2022, 5, 31, 9, 8, 0, "-07:00")"#, t);
106
+ ///
107
+ /// Ok(())
108
+ /// }
109
+ /// # Ruby::init(example).unwrap()
110
+ /// ```
111
+ pub fn time_timespec_new(&self, ts: Timespec, offset: Offset) -> Result<Time, Error> {
112
+ protect(|| unsafe {
113
+ Time::from_rb_value_unchecked(rb_time_timespec_new(
114
+ &ts.into() as *const _,
115
+ offset.as_c_int(),
116
+ ))
117
+ })
118
+ }
119
+ }
120
+
121
+ /// Struct representing a point in time as an offset from the UNIX epoch.
122
+ #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)]
123
+ pub struct Timespec {
124
+ /// Seconds since the UNIX epoch.
125
+ pub tv_sec: i64,
126
+ /// Subsecond offset in nanoseconds.
127
+ pub tv_nsec: i64,
128
+ }
129
+
130
+ impl From<timespec> for Timespec {
131
+ fn from(val: timespec) -> Self {
132
+ Self {
133
+ tv_sec: val.tv_sec as _,
134
+ tv_nsec: val.tv_nsec as _,
135
+ }
136
+ }
137
+ }
138
+
139
+ impl From<Timespec> for timespec {
140
+ fn from(val: Timespec) -> Self {
141
+ Self {
142
+ tv_sec: val.tv_sec as _,
143
+ tv_nsec: val.tv_nsec as _,
144
+ }
145
+ }
146
+ }
147
+
148
+ #[derive(Clone, Copy, Debug, PartialEq, Eq)]
149
+ enum OffsetType {
150
+ Local,
151
+ UTC,
152
+ Offset(c_int),
153
+ }
154
+
155
+ /// Struct representing an offset from UTC.
156
+ #[derive(Clone, Copy, Debug, PartialEq, Eq)]
157
+ pub struct Offset(OffsetType);
158
+
159
+ impl Offset {
160
+ /// Creates a new `Offset` from the specified number of seconds.
161
+ pub fn from_secs(offset: i32) -> Result<Self, OffsetError> {
162
+ match offset {
163
+ -86400..=86400 => Ok(Self(OffsetType::Offset(offset as _))),
164
+ _ => Err(OffsetError(offset)),
165
+ }
166
+ }
167
+
168
+ /// Creates a new `Offset` from the specified number of minutes.
169
+ pub fn from_mins(offset: i32) -> Result<Self, OffsetError> {
170
+ Self::from_secs(offset * 60)
171
+ }
172
+
173
+ /// Creates a new `Offset` from the specified number of hours.
174
+ pub fn from_hours(offset: i32) -> Result<Self, OffsetError> {
175
+ Self::from_secs(offset * 60)
176
+ }
177
+
178
+ /// Create a new `Offset` representing local time.
179
+ pub fn local() -> Self {
180
+ Self(OffsetType::Local)
181
+ }
182
+
183
+ /// Create a new `Offset` representing UTC.
184
+ pub fn utc() -> Self {
185
+ Self(OffsetType::UTC)
186
+ }
187
+
188
+ fn as_c_int(&self) -> c_int {
189
+ match self.0 {
190
+ OffsetType::Local => c_int::MAX,
191
+ OffsetType::UTC => c_int::MAX - 1,
192
+ OffsetType::Offset(i) => i,
193
+ }
194
+ }
195
+ }
196
+
197
+ /// An error returned when an [`Offset`] is out of range.
198
+ #[derive(Debug)]
199
+ pub struct OffsetError(i32);
200
+
201
+ impl fmt::Display for OffsetError {
202
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
203
+ write!(f, "utc_offset {} out of range (-86400 to 86400)", self.0)
204
+ }
205
+ }
206
+
207
+ impl std::error::Error for OffsetError {}
208
+
209
+ impl IntoError for OffsetError {
210
+ #[inline]
211
+ fn into_error(self, ruby: &Ruby) -> Error {
212
+ Error::new(ruby.exception_arg_error(), self.to_string())
213
+ }
214
+ }
215
+
216
+ /// Wrapper type for a Value known to be an instance of Ruby's Time class.
217
+ ///
218
+ /// See the [`ReprValue`] and [`Object`] traits for additional methods
219
+ /// available on this type. See [`Ruby`](Ruby#time) for methods to create a
220
+ /// `Time`.
221
+ #[derive(Clone, Copy)]
222
+ #[repr(transparent)]
223
+ pub struct Time(RTypedData);
224
+
225
+ impl Time {
226
+ /// Return `Some(Time)` if `val` is a `Time`, `None` otherwise.
227
+ ///
228
+ /// # Examples
229
+ ///
230
+ /// ```
231
+ /// use magnus::eval;
232
+ /// # let _cleanup = unsafe { magnus::embed::init() };
233
+ ///
234
+ /// assert!(magnus::Time::from_value(eval("Time.now").unwrap()).is_some());
235
+ /// assert!(magnus::Time::from_value(eval("0").unwrap()).is_none());
236
+ /// ```
237
+ #[inline]
238
+ pub fn from_value(val: Value) -> Option<Self> {
239
+ RTypedData::from_value(val)
240
+ .filter(|_| val.is_kind_of(Ruby::get_with(val).class_time()))
241
+ .map(Self)
242
+ }
243
+
244
+ #[inline]
245
+ pub(crate) unsafe fn from_rb_value_unchecked(val: VALUE) -> Self {
246
+ Self(RTypedData::from_rb_value_unchecked(val))
247
+ }
248
+
249
+ /// Returns the timezone offset of `self` from UTC in seconds.
250
+ ///
251
+ /// # Examples
252
+ ///
253
+ /// ```
254
+ /// use magnus::{Error, Ruby, Time};
255
+ ///
256
+ /// fn example(ruby: &Ruby) -> Result<(), Error> {
257
+ /// let t: Time = ruby.eval(r#"Time.new(2022, 5, 31, 9, 8, 0, "-07:00")"#)?;
258
+ ///
259
+ /// assert_eq!(t.utc_offset(), -25_200);
260
+ ///
261
+ /// Ok(())
262
+ /// }
263
+ /// # Ruby::init(example).unwrap()
264
+ /// ```
265
+ pub fn utc_offset(self) -> i64 {
266
+ unsafe { Fixnum::from_rb_value_unchecked(rb_time_utc_offset(self.as_rb_value())).to_i64() }
267
+ }
268
+
269
+ /// Returns `self` as a [`Timespec`].
270
+ ///
271
+ /// # Examples
272
+ ///
273
+ /// ```
274
+ /// use magnus::{Error, Ruby, Time};
275
+ ///
276
+ /// fn example(ruby: &Ruby) -> Result<(), Error> {
277
+ /// let t: Time =
278
+ /// ruby.eval(r#"Time.new(2022, 5, 31, 9, 8, 123456789/1000000000r, "-07:00")"#)?;
279
+ ///
280
+ /// assert_eq!(t.timespec()?.tv_sec, 1654013280);
281
+ /// assert_eq!(t.timespec()?.tv_nsec, 123456789);
282
+ ///
283
+ /// Ok(())
284
+ /// }
285
+ /// # Ruby::init(example).unwrap()
286
+ /// ```
287
+ pub fn timespec(self) -> Result<Timespec, Error> {
288
+ let mut timespec = timespec {
289
+ tv_sec: 0,
290
+ tv_nsec: 0,
291
+ };
292
+ protect(|| unsafe {
293
+ timespec = rb_time_timespec(self.as_rb_value());
294
+ Ruby::get_unchecked().qnil()
295
+ })?;
296
+ Ok(timespec.into())
297
+ }
298
+ }
299
+
300
+ impl fmt::Display for Time {
301
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
302
+ write!(f, "{}", unsafe { self.to_s_infallible() })
303
+ }
304
+ }
305
+
306
+ impl fmt::Debug for Time {
307
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
308
+ write!(f, "{}", self.inspect())
309
+ }
310
+ }
311
+
312
+ impl IntoValue for Time {
313
+ #[inline]
314
+ fn into_value_with(self, _: &Ruby) -> Value {
315
+ self.0.as_value()
316
+ }
317
+ }
318
+
319
+ impl IntoValue for SystemTime {
320
+ #[inline]
321
+ fn into_value_with(self, ruby: &Ruby) -> Value {
322
+ match self.duration_since(Self::UNIX_EPOCH) {
323
+ Ok(duration) => ruby
324
+ .time_nano_new(
325
+ duration.as_secs().try_into().unwrap(),
326
+ duration.subsec_nanos().into(),
327
+ )
328
+ .unwrap()
329
+ .as_value(),
330
+ Err(_) => {
331
+ let duration = Self::UNIX_EPOCH.duration_since(self).unwrap();
332
+ ruby.time_nano_new(
333
+ -i64::try_from(duration.as_secs()).unwrap(),
334
+ -i64::from(duration.subsec_nanos()),
335
+ )
336
+ .unwrap()
337
+ .as_value()
338
+ }
339
+ }
340
+ }
341
+ }
342
+
343
+ #[cfg(feature = "chrono")]
344
+ #[cfg_attr(docsrs, doc(cfg(feature = "chrono")))]
345
+ impl IntoValue for chrono::DateTime<chrono::Utc> {
346
+ #[inline]
347
+ fn into_value_with(self, ruby: &Ruby) -> Value {
348
+ let delta = self.signed_duration_since(Self::UNIX_EPOCH);
349
+ let ts = Timespec {
350
+ tv_sec: delta.num_seconds(),
351
+ tv_nsec: delta.subsec_nanos() as _,
352
+ };
353
+ ruby.time_timespec_new(ts, Offset::utc())
354
+ .unwrap()
355
+ .as_value()
356
+ }
357
+ }
358
+
359
+ #[cfg(feature = "chrono")]
360
+ #[cfg_attr(docsrs, doc(cfg(feature = "chrono")))]
361
+ impl IntoValue for chrono::DateTime<chrono::FixedOffset> {
362
+ #[inline]
363
+ fn into_value_with(self, ruby: &Ruby) -> Value {
364
+ use chrono::{DateTime, FixedOffset, Utc};
365
+ let delta = self.signed_duration_since(DateTime::<Utc>::UNIX_EPOCH);
366
+ let ts = Timespec {
367
+ tv_sec: delta.num_seconds(),
368
+ tv_nsec: delta.subsec_nanos() as _,
369
+ };
370
+ let offset: FixedOffset = self.timezone();
371
+ let offset = Offset::from_secs(offset.local_minus_utc()).unwrap();
372
+ ruby.time_timespec_new(ts, offset).unwrap().as_value()
373
+ }
374
+ }
375
+
376
+ impl Object for Time {}
377
+
378
+ unsafe impl private::ReprValue for Time {}
379
+
380
+ impl ReprValue for Time {}
381
+
382
+ impl TryConvert for Time {
383
+ fn try_convert(val: Value) -> Result<Self, Error> {
384
+ Self::from_value(val).ok_or_else(|| {
385
+ Error::new(
386
+ Ruby::get_with(val).exception_type_error(),
387
+ format!("no implicit conversion of {} into Time", unsafe {
388
+ val.classname()
389
+ },),
390
+ )
391
+ })
392
+ }
393
+ }
394
+
395
+ impl TryConvert for SystemTime {
396
+ fn try_convert(val: Value) -> Result<Self, Error> {
397
+ let mut timespec = timespec {
398
+ tv_sec: 0,
399
+ tv_nsec: 0,
400
+ };
401
+ protect(|| unsafe {
402
+ timespec = rb_time_timespec(val.as_rb_value());
403
+ Ruby::get_unchecked().qnil()
404
+ })?;
405
+ if timespec.tv_nsec >= 0 {
406
+ let mut duration = Duration::from_secs(timespec.tv_sec.unsigned_abs() as _);
407
+ duration += Duration::from_nanos(timespec.tv_nsec as _);
408
+ if timespec.tv_sec >= 0 {
409
+ Ok(Self::UNIX_EPOCH + duration)
410
+ } else {
411
+ Ok(Self::UNIX_EPOCH - duration)
412
+ }
413
+ } else {
414
+ Err(Error::new(
415
+ Ruby::get_with(val).exception_arg_error(),
416
+ "time nanos must not be negative",
417
+ ))
418
+ }
419
+ }
420
+ }
421
+
422
+ #[cfg(feature = "chrono")]
423
+ #[cfg_attr(docsrs, doc(cfg(feature = "chrono")))]
424
+ impl TryConvert for chrono::DateTime<chrono::Utc> {
425
+ fn try_convert(val: Value) -> Result<Self, Error> {
426
+ let mut timespec = timespec {
427
+ tv_sec: 0,
428
+ tv_nsec: 0,
429
+ };
430
+ protect(|| unsafe {
431
+ timespec = rb_time_timespec(val.as_rb_value());
432
+ Ruby::get_unchecked().qnil()
433
+ })?;
434
+ match chrono::Duration::new(timespec.tv_sec as _, timespec.tv_nsec as _) {
435
+ Some(duration) => Ok(Self::UNIX_EPOCH + duration),
436
+ None => Err(Error::new(
437
+ Ruby::get_with(val).exception_arg_error(),
438
+ "time out of range",
439
+ )),
440
+ }
441
+ }
442
+ }
443
+
444
+ #[cfg(feature = "chrono")]
445
+ #[cfg_attr(docsrs, doc(cfg(feature = "chrono")))]
446
+ impl TryConvert for chrono::DateTime<chrono::FixedOffset> {
447
+ fn try_convert(val: Value) -> Result<Self, Error> {
448
+ use chrono::{DateTime, FixedOffset, Utc};
449
+ let offset: i32 = val.funcall("utc_offset", ())?;
450
+ let dt: DateTime<Utc> = TryConvert::try_convert(val)?;
451
+ let tz = match FixedOffset::east_opt(offset) {
452
+ Some(tz) => tz,
453
+ None => {
454
+ return Err(Error::new(
455
+ Ruby::get_with(val).exception_arg_error(),
456
+ "invalid UTC offset",
457
+ ))
458
+ }
459
+ };
460
+ Ok(dt.with_timezone(&tz))
461
+ }
462
+ }
@@ -26,7 +26,7 @@ pub trait TryConvert: Sized {
26
26
  /// Conversions from [`Value`] to Rust types that do not contain [`Value`].
27
27
  ///
28
28
  /// This trait is used as a bound on some implementations of [`TryConvert`]
29
- /// (for example, for [`Vec`]) to prevent heap allocated datastructures
29
+ /// (for example, for [`Vec`]) to prevent heap allocated data structures
30
30
  /// containing `Value`, as it is not safe to store a `Value` on the heap.
31
31
  ///
32
32
  /// # Safety
@@ -86,6 +86,14 @@ impl TryConvert for i64 {
86
86
  }
87
87
  unsafe impl TryConvertOwned for i64 {}
88
88
 
89
+ impl TryConvert for i128 {
90
+ #[inline]
91
+ fn try_convert(val: Value) -> Result<Self, Error> {
92
+ Integer::try_convert(val)?.to_i128()
93
+ }
94
+ }
95
+ unsafe impl TryConvertOwned for i128 {}
96
+
89
97
  impl TryConvert for isize {
90
98
  #[inline]
91
99
  fn try_convert(val: Value) -> Result<Self, Error> {
@@ -126,6 +134,14 @@ impl TryConvert for u64 {
126
134
  }
127
135
  unsafe impl TryConvertOwned for u64 {}
128
136
 
137
+ impl TryConvert for u128 {
138
+ #[inline]
139
+ fn try_convert(val: Value) -> Result<Self, Error> {
140
+ Integer::try_convert(val)?.to_u128()
141
+ }
142
+ }
143
+ unsafe impl TryConvertOwned for u128 {}
144
+
129
145
  impl TryConvert for usize {
130
146
  #[inline]
131
147
  fn try_convert(val: Value) -> Result<Self, Error> {
@@ -134,6 +150,34 @@ impl TryConvert for usize {
134
150
  }
135
151
  unsafe impl TryConvertOwned for usize {}
136
152
 
153
+ macro_rules! impl_non_zero_try_convert {
154
+ ($type:ty, $prim:ty) => {
155
+ impl TryConvert for $type {
156
+ #[inline]
157
+ fn try_convert(val: Value) -> Result<Self, Error> {
158
+ <$type>::new(<$prim>::try_convert(val)?).ok_or(Error::new(
159
+ Ruby::get_with(val).exception_arg_error(),
160
+ "value must be non-zero",
161
+ ))
162
+ }
163
+ }
164
+ unsafe impl TryConvertOwned for $type {}
165
+ };
166
+ }
167
+
168
+ impl_non_zero_try_convert!(std::num::NonZeroI8, i8);
169
+ impl_non_zero_try_convert!(std::num::NonZeroI16, i16);
170
+ impl_non_zero_try_convert!(std::num::NonZeroI32, i32);
171
+ impl_non_zero_try_convert!(std::num::NonZeroI64, i64);
172
+ impl_non_zero_try_convert!(std::num::NonZeroI128, i128);
173
+ impl_non_zero_try_convert!(std::num::NonZeroIsize, isize);
174
+ impl_non_zero_try_convert!(std::num::NonZeroU8, u8);
175
+ impl_non_zero_try_convert!(std::num::NonZeroU16, u16);
176
+ impl_non_zero_try_convert!(std::num::NonZeroU32, u32);
177
+ impl_non_zero_try_convert!(std::num::NonZeroU64, u64);
178
+ impl_non_zero_try_convert!(std::num::NonZeroU128, u128);
179
+ impl_non_zero_try_convert!(std::num::NonZeroUsize, usize);
180
+
137
181
  impl TryConvert for f32 {
138
182
  #[inline]
139
183
  fn try_convert(val: Value) -> Result<Self, Error> {
@@ -240,7 +284,7 @@ macro_rules! impl_try_convert {
240
284
  }
241
285
  unsafe impl<#(T~N,)*> TryConvertOwned for (#(T~N,)*)
242
286
  where
243
- #(T~N: TryConvert,)*
287
+ #(T~N: TryConvertOwned,)*
244
288
  {
245
289
  }
246
290
  });
@@ -269,6 +313,24 @@ where
269
313
  {
270
314
  }
271
315
 
316
+ impl<K, V> TryConvert for std::collections::BTreeMap<K, V>
317
+ where
318
+ K: TryConvertOwned + Eq + std::hash::Hash + Ord,
319
+ V: TryConvertOwned,
320
+ {
321
+ #[inline]
322
+ fn try_convert(val: Value) -> Result<Self, Error> {
323
+ debug_assert_value!(val);
324
+ RHash::try_convert(val)?.to_btree_map()
325
+ }
326
+ }
327
+ unsafe impl<K, V> TryConvertOwned for std::collections::BTreeMap<K, V>
328
+ where
329
+ K: TryConvertOwned + Eq + std::hash::Hash + Ord,
330
+ V: TryConvertOwned,
331
+ {
332
+ }
333
+
272
334
  #[cfg(unix)]
273
335
  impl TryConvert for PathBuf {
274
336
  fn try_convert(val: Value) -> Result<Self, Error> {