libserialize: Remove float preprocessing in serialize::json::Encoder
libserialize: Remove float preprocessing in serialize::json::Encoder

serialize::json::Encoder currently uses f64 to emit any integral type.
This is possibly due to the behavior of JavaScript, which uses f64 to
represent any numeric value.

This leads to a problem that only the integers in the range of [-2^53+1,
2^53-1] can be encoded. Therefore, i64 and u64 cannot be used reliably
in the current implementation.

RFC 7159 suggests that good interoperability can be achieved if the
range is respected by implementations. However, it also says that
implementations are allowed to set the range of number accepted. And it
seems that the JSON encoders outside of the JavaScript world usually
make use of i64 values.

This commit removes the float preprocessing done in the emit_* methods.
It also increases performance, because transforming f64 into String
costs more than that of an integral type.

Fixes #18319

[breaking-change]

kimroen/rust,GBGamer/rust,mvdnes/rust,jashank/rust,jashank/rust,kwantam/rust,philyoon/rust,XMPPwocky/rust,kwantam/rust,GBGamer/rust,dwillmer/rust,dwillmer/rust,sae-bom/rust,jroesch/rust,kimroen/rust,seanrivera/rust,AerialX/rust,mahkoh/rust,TheNeikos/rust,robertg/rust,mvdnes/rust,gifnksm/rust,kwantam/rust,AerialX/rust-rt-minimal,mdinger/rust,reem/rust,l0kod/rust,AerialX/rust,mihneadb/rust,miniupnp/rust,XMPPwocky/rust,ejjeong/rust,aepsil0n/rust,gifnksm/rust,ruud-v-a/rust,zaeleus/rust,mihneadb/rust,vhbit/rust,dinfuehr/rust,robertg/rust,graydon/rust,ebfull/rust,reem/rust,ktossell/rust,gifnksm/rust,ktossell/rust,dwillmer/rust,krzysz00/rust,AerialX/rust-rt-minimal,aneeshusa/rust,omasanori/rust,bombless/rust,GBGamer/rust,zubron/rust,AerialX/rust,l0kod/rust,carols10cents/rust,zubron/rust,zubron/rust,mvdnes/rust,gifnksm/rust,zaeleus/rust,KokaKiwi/rust,jashank/rust,untitaker/rust,ebfull/rust,l0kod/rust,victorvde/rust,pelmers/rust,l0kod/rust,l0kod/rust,miniupnp/rust,GBGamer/rust,robertg/rust,vhbit/rust,emk/rust,cllns/rust,aneeshusa/rust,sae-bom/rust,krzysz00/rust,nwin/rust,ebfull/rust,avdi/rust,richo/rust,philyoon/rust,krzysz00/rust,defuz/rust,victorvde/rust,sae-bom/rust,vhbit/rust,jroesch/rust,jroesch/rust,AerialX/rust-rt-minimal,emk/rust,AerialX/rust-rt-minimal,carols10cents/rust,pelmers/rust,victorvde/rust,dinfuehr/rust,emk/rust,victorvde/rust,nwin/rust,jashank/rust,mdinger/rust,defuz/rust,pelmers/rust,aneeshusa/rust,miniupnp/rust,GBGamer/rust,pshc/rust,miniupnp/rust,ebfull/rust,hauleth/rust,andars/rust,untitaker/rust,aepsil0n/rust,ktossell/rust,mvdnes/rust,ktossell/rust,bombless/rust,KokaKiwi/rust,richo/rust,defuz/rust,omasanori/rust,vhbit/rust,zachwick/rust,dwillmer/rust,zachwick/rust,miniupnp/rust,cllns/rust,gifnksm/rust,robertg/rust,GBGamer/rust,victorvde/rust,kwantam/rust,vhbit/rust,pshc/rust,l0kod/rust,emk/rust,rprichard/rust,pshc/rust,bombless/rust,rohitjoshi/rust,rohitjoshi/rust,untitaker/rust,dinfuehr/rust,KokaKiwi/rust,jroesch/rust,KokaKiwi/rust,emk/rust,AerialX/rust,zachwick/rust,philyoon/rust,untitaker/rust,TheNeikos/rust,seanrivera/rust,omasanori/rust,TheNeikos/rust,hauleth/rust,hauleth/rust,vhbit/rust,reem/rust,kimroen/rust,pshc/rust,TheNeikos/rust,hauleth/rust,aidancully/rust,richo/rust,hauleth/rust,rohitjoshi/rust,mihneadb/rust,omasanori/rust,omasanori/rust,aneeshusa/rust,ruud-v-a/rust,avdi/rust,hauleth/rust,aneeshusa/rust,ejjeong/rust,graydon/rust,miniupnp/rust,mahkoh/rust,sae-bom/rust,rohitjoshi/rust,mahkoh/rust,ruud-v-a/rust,rohitjoshi/rust,rprichard/rust,kimroen/rust,kwantam/rust,miniupnp/rust,mdinger/rust,robertg/rust,dwillmer/rust,rprichard/rust,rprichard/rust,aepsil0n/rust,zaeleus/rust,defuz/rust,krzysz00/rust,omasanori/rust,zubron/rust,avdi/rust,rprichard/rust,carols10cents/rust,richo/rust,philyoon/rust,graydon/rust,dwillmer/rust,pshc/rust,mihneadb/rust,zubron/rust,rprichard/rust,mahkoh/rust,cllns/rust,nwin/rust,carols10cents/rust,pshc/rust,cllns/rust,XMPPwocky/rust,bombless/rust,GBGamer/rust,emk/rust,reem/rust,bombless/rust-docs-chinese,mdinger/rust,richo/rust,andars/rust,krzysz00/rust,nwin/rust,graydon/rust,carols10cents/rust,ruud-v-a/rust,pelmers/rust,untitaker/rust,defuz/rust,zachwick/rust,graydon/rust,aidancully/rust,bombless/rust,TheNeikos/rust,pshc/rust,AerialX/rust-rt-minimal,krzysz00/rust,kimroen/rust,jashank/rust,jashank/rust,pshc/rust,aidancully/rust,mvdnes/rust,dinfuehr/rust,AerialX/rust-rt-minimal,zaeleus/rust,seanrivera/rust,mihneadb/rust,cllns/rust,richo/rust,aneeshusa/rust,zaeleus/rust,andars/rust,jashank/rust,cllns/rust,avdi/rust,mihneadb/rust,dinfuehr/rust,graydon/rust,dinfuehr/rust,sae-bom/rust,GBGamer/rust,ruud-v-a/rust,nwin/rust,nwin/rust,nwin/rust,avdi/rust,l0kod/rust,zachwick/rust,untitaker/rust,XMPPwocky/rust,jashank/rust,sae-bom/rust,ejjeong/rust,rohitjoshi/rust,zachwick/rust,emk/rust,avdi/rust,mahkoh/rust,ktossell/rust,robertg/rust,jroesch/rust,ejjeong/rust,XMPPwocky/rust,pelmers/rust,zubron/rust,reem/rust,dwillmer/rust,KokaKiwi/rust,jroesch/rust,andars/rust,aidancully/rust,ejjeong/rust,nwin/rust,AerialX/rust,dwillmer/rust,victorvde/rust,TheNeikos/rust,gifnksm/rust,ebfull/rust,kimroen/rust,kwantam/rust,seanrivera/rust,mdinger/rust,ebfull/rust,jroesch/rust,XMPPwocky/rust,ejjeong/rust,vhbit/rust,seanrivera/rust,KokaKiwi/rust,aidancully/rust,philyoon/rust,jroesch/rust,mdinger/rust,aepsil0n/rust,mahkoh/rust,ktossell/rust,kimroen/rust,AerialX/rust,aepsil0n/rust,ruud-v-a/rust,aepsil0n/rust,zaeleus/rust,zubron/rust,pelmers/rust,l0kod/rust,aidancully/rust,zubron/rust,andars/rust,vhbit/rust,seanrivera/rust,mvdnes/rust,defuz/rust,andars/rust,carols10cents/rust,bombless/rust,ktossell/rust,miniupnp/rust,philyoon/rust,reem/rust